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

Function TM_windowOpenFix

src/environment.js:573–589  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

571};
572
573function TM_windowOpenFix() {
574 if (TMwin.use.safeContext) {
575 // redefine window.open to a function the returns the DOMWindow of the opened window
576 window.open = function(url) {
577 var fi = '__o__' + TM_context_id;
578 var f = 'window.' + fi + ' = window.open(decodeURI("' + encodeURI(url) + '"));';
579 TM_do(f);
580 var ret = unsafeWindow[fi];
581 delete unsafeWindow[fi];
582 return ret;
583 };
584
585 Clean.push(function() {
586 window.open = null;
587 });
588 }
589};
590
591function TM_winEvalFix() {
592 if (!TMwin.use.safeContext || window.__setTimeout) return;

Callers 1

environment.jsFile · 0.85

Calls 1

TM_doFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…