MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / wrappedJSObjectFix

Function wrappedJSObjectFix

src/content.js:650–677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

648}
649
650function wrappedJSObjectFix() {
651 var arr = [ window['HTMLElement'].prototype, document.__proto__ ];
652 for (var o=0; o < arr.length; o++) {
653 var wrap = function() {
654 var k = arr[o];
655 var obj = Object.getOwnPropertyDescriptor(k, 'wrappedJSObject');
656
657 if (!obj) {
658 var prop = { 'wrappedJSObject':
659 {
660 get: function() {
661 return this;
662 },
663 enumerable: false,
664 configurable: true
665 },
666 };
667 Object.defineProperties(k, prop);
668
669 Clean.push(function() {
670 if (CV) console.log("clean: " + Helper.toType(k) + "[wrappedJSObject]");
671 delete k['wrappedJSObject'];
672 });
673 }
674 };
675 wrap();
676 }
677};
678
679function domAttrFix() {
680 var logged = false;

Callers 1

content.jsFile · 0.85

Calls 1

wrapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…