Ver Fonte

fix: old FF defines head in HTMLDocument

tophf há 5 anos atrás
pai
commit
2ea6e96c2f
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      src/injected/content/inject.js

+ 2 - 1
src/injected/content/inject.js

@@ -22,7 +22,8 @@ defineProperty(window, process.env.INIT_FUNC_NAME, { value: 1 });
 
 const { document, setTimeout } = global;
 // Userscripts in content mode may redefine head and documentElement
-const { get: getHead } = describeProperty(Document.prototype, 'head');
+const { get: getHead } = describeProperty(Document.prototype, 'head')
+  || describeProperty(HTMLDocument.prototype, 'head'); // old FF before 61;
 const { get: getDocElem } = describeProperty(Document.prototype, 'documentElement');
 const { appendChild } = Document.prototype; // same as Node.appendChild