diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 195088cf1..87edc757d 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -223,7 +223,6 @@ const contentObserver = { } else { // Sandbox appears void. // I've seen this happens, need to investigate why. - } }; } @@ -325,6 +324,7 @@ const contentObserver = { lss(this.contentBaseURI + 'vapi-client.js', sandbox); lss(this.contentBaseURI + 'contentscript-start.js', sandbox); } catch (ex) { + //console.exception(ex.msg, ex.stack); return; } diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index f8ed63e21..dab4e4f86 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -791,7 +791,7 @@ var tabWatcher = (function() { } var tabId = browserToTabIdMap.get(browser); if ( tabId === undefined ) { - tabId = 't' + tabIdGenerator++; + tabId = '' + tabIdGenerator++; browserToTabIdMap.set(browser, tabId); tabIdToBrowserMap.set(tabId, browser); } @@ -1212,9 +1212,13 @@ var httpObserver = { 5: 'object', 6: 'main_frame', 7: 'sub_frame', + 10: 'ping', 11: 'xmlhttprequest', 12: 'object', 14: 'font', + 15: 'media', + 16: 'websocket', + 19: 'beacon', 21: 'image' }, diff --git a/platform/firefox/vapi-client.js b/platform/firefox/vapi-client.js index b5fd7d4c8..b62a9b593 100644 --- a/platform/firefox/vapi-client.js +++ b/platform/firefox/vapi-client.js @@ -33,7 +33,7 @@ var vAPI = self.vAPI = self.vAPI || {}; vAPI.firefox = true; -vAPI.sessionId = String.fromCharCode(Date.now() % 25 + 97) + +vAPI.sessionId = String.fromCharCode(Date.now() % 26 + 97) + Math.random().toString(36).slice(2); /******************************************************************************/ @@ -127,7 +127,13 @@ vAPI.messaging = { return; } - self.injectScript(details.file); + // TODO: investigate why this happens, and if this happens + // legitimately (content scripts not injected I suspect, so + // that would make this legitimate). + // Case: open popup UI from icon in uBlock's logger + if ( typeof self.injectScript === 'function' ) { + self.injectScript(details.file); + } } }; },