mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Always use exportFunctionWithName
This commit is contained in:
parent
af1dfe755c
commit
6fb7622fec
4 changed files with 44 additions and 47 deletions
|
@ -169,7 +169,7 @@
|
|||
|
||||
const matchMediaDescriptor = Object.getOwnPropertyDescriptor(wrappedWindow, "matchMedia");
|
||||
const originalMatchMedia = matchMediaDescriptor.value;
|
||||
matchMediaDescriptor.value = exportFunction(function matchMedia(query){
|
||||
matchMediaDescriptor.value = extension.exportFunctionWithName(function matchMedia(query){
|
||||
if (query === extensionSecret[0]){
|
||||
return extensionSecret[1];
|
||||
}
|
||||
|
@ -178,7 +178,7 @@
|
|||
originalMatchMedia.apply(this, wrappedWindow.Array.from(arguments)):
|
||||
originalMatchMedia.call(this, query);
|
||||
}
|
||||
}, window);
|
||||
}, window, originalMatchMedia.name);
|
||||
Object.defineProperty(wrappedWindow, "matchMedia", matchMediaDescriptor);
|
||||
|
||||
interceptedWindows.set(wrappedWindow, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue