From ba54b43fc490bf00be2850fffedd6e422ea0b885 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 27 Jan 2015 13:42:17 -0500 Subject: [PATCH] trivial improvements --- src/js/contentscript-end.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index 82ce59fc7..98b347b1f 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -545,7 +545,7 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); if ( typeof src !== 'string' || src === '' ) { return; } - if ( src.slice(0, 4) !== 'http' ) { + if ( src.lastIndexOf('http', 0) !== 0 ) { return; } @@ -584,12 +584,12 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); }; var onResourceLoaded = function(ev) { - //console.debug('Loaded %s[src="%s"]', ev.target.tagName, ev.target.src); + //console.debug('onResourceLoaded(%o)', ev); onResource(ev.target, loadedElements); }; var onResourceFailed = function(ev) { - //console.debug('Failed to load %s[src="%s"]', ev.target.tagName, ev.target.src); + //console.debug('onResourceFailed(%o)', ev); onResource(ev.target, failedElements); }; @@ -661,7 +661,7 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); if ( typeof src !== 'string' || src === '' ) { continue; } - if ( src.slice(0, 4) !== 'http' ) { + if ( src.lastIndexOf('http', 0) !== 0 ) { continue; } requests.push({