Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.addEventListener #132

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
.c9revisions
src/temp.*.js
src/temp.js
/sauce_connect.log
12 changes: 6 additions & 6 deletions dist/catiline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! catiline 2.9.3 2013-10-25*/
/*! catiline 2.9.3 2015-01-30*/
/*!©2013 Calvin Metcalf @license MIT https://github.com/calvinmetcalf/catiline */
if (typeof document === 'undefined') {
self._noTransferable=true;
Expand All @@ -23,7 +23,7 @@ var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
observer.observe(element, { attributes: true });

// Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661
addEventListener('unload', function () {
window.addEventListener('unload', function () {
observer.disconnect();
observer = null;
}, false);
Expand All @@ -32,7 +32,7 @@ var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
};
}else{
var codeWord = 'com.catiline.setImmediate' + Math.random();
addEventListener('message', function (event) {
window.addEventListener('message', function (event) {
// This will catch all incoming messages (even from other windows!), so we need to try reasonably hard to
// avoid letting anyone else trick us into firing off. We test the origin is still this window, and that a
// (randomly generated) unpredictable identifying prefix is present.
Expand Down Expand Up @@ -227,10 +227,10 @@ function regexImports(string){
}
};
while(match){
match = rest.match(/(importScripts\(.*?\);?)/);
rest = rest.replace(/(importScripts\(\s*(?:[\'\"].*?[\'\"])?\s*\);?)/,'\n');
match = rest.match(/(importScripts\(.*?\)[;|,]?)/);
rest = rest.replace(/(importScripts\(\s*(?:[\'\"].*?[\'\"])?\s*\)[;|,]?)/,'\n');
if(match){
match[0].replace(/importScripts\(\s*([\'\"].*?[\'\"])?\s*\);?/g,loopFunc);
match[0].replace(/importScripts\(\s*([\'\"].*?[\'\"])?\s*\)[;|,]?/g,loopFunc);
}
}
matches = Object.keys(matches);
Expand Down
Loading