Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var changed = 0;
- window.addEventListener('beforescriptexecute', function (e) {
- src = e.target.src;
- if (src.search(/main_out\.js..../) != -1) {
- changed++;
- e.preventDefault();
- e.stopPropagation();
- append(new_main_out);
- };
- if (changed == 1)
- window.removeEventListener(e.type, arguments.callee, true);
- }, true);
- function append(s) {
- console.log('append fired');
- document.head.appendChild(document.createElement('script'))
- .innerHTML = s.toString().replace(/^function.*{|}$/g, '');
- }
- function new_main_out() {
- // main_out.js
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement