1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Always use exportFunctionWithName

This commit is contained in:
kkapsner 2019-12-13 17:34:14 +01:00
parent af1dfe755c
commit 6fb7622fec
4 changed files with 44 additions and 47 deletions

View file

@ -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);