MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
Replaced content with "→Any JavaScript here will be loaded for all users on every page load. importScript('User:Rillke/bigChunkedUpload.js');: " Tag: Replaced |
No edit summary |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. importScript('User:Rillke/bigChunkedUpload.js');*/ | /* Any JavaScript here will be loaded for all users on every page load. importScript('User:Rillke/bigChunkedUpload.js');*/ | ||
<nowiki> | |||
var npDetect = new (function () { | |||
this.blocking = false; | |||
var errcnt = 0; | |||
function testImg() { | |||
var i = new Image(); | |||
i.onerror = () => { | |||
errcnt++; | |||
if (errcnt < 3) { | |||
setTimeout(testImg, 250); | |||
} else { | |||
npDetect.blocking = true; | |||
if (document.dispatchEvent && window.CustomEvent) { | |||
document.dispatchEvent( | |||
new CustomEvent('np.blocking', { | |||
detail: { | |||
blocking: npDetect.blocking, | |||
}, | |||
}) | |||
); | |||
} | |||
} | |||
}; | |||
i.onload = () => { | |||
npDetect.blocking = false; | |||
}; | |||
i.src = 'https://s.nitropay.com/1.gif?' + Math.random() + '&adslot='; | |||
} | |||
testImg(); | |||
})(); | |||
</nowiki> | |||
Revision as of 01:36, 17 November 2022
/* Any JavaScript here will be loaded for all users on every page load. importScript('User:Rillke/bigChunkedUpload.js');*/
<nowiki>
var npDetect = new (function () {
this.blocking = false;
var errcnt = 0;
function testImg() {
var i = new Image();
i.onerror = () => {
errcnt++;
if (errcnt < 3) {
setTimeout(testImg, 250);
} else {
npDetect.blocking = true;
if (document.dispatchEvent && window.CustomEvent) {
document.dispatchEvent(
new CustomEvent('np.blocking', {
detail: {
blocking: npDetect.blocking,
},
})
);
}
}
};
i.onload = () => {
npDetect.blocking = false;
};
i.src = 'https://s.nitropay.com/1.gif?' + Math.random() + '&adslot=';
}
testImg();
})();
</nowiki>