Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/devtools.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Rebase Created Oct. 13, 2017, 4:53 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/cssInjection.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/devtools.js
===================================================================
--- a/lib/devtools.js
+++ b/lib/devtools.js
@@ -248,17 +248,17 @@
let panel = panels.get(tabId);
// Reloading the tab is the only way that allows bypassing all caches, in
// order to see all requests in the devtools panel. Reloading must not be
// performed before the tab changes to "loading", otherwise it will load the
// previous URL.
if (panel && panel.reload)
{
- chrome.tabs.reload(tabId, {bypassCache: true});
+ browser.tabs.reload(tabId, {bypassCache: true});
panel.reload = false;
panel.reloading = true;
}
}
function updateFilters(filters, added)
{
@@ -329,26 +329,26 @@
}
function onSubscriptionAdded(subscription)
{
if (subscription instanceof SpecialSubscription)
updateFilters(subscription.filters, true);
}
-chrome.runtime.onConnect.addListener(newPort =>
+browser.runtime.onConnect.addListener(newPort =>
{
let match = newPort.name.match(/^devtools-(\d+)$/);
if (!match)
return;
let inspectedTabId = parseInt(match[1], 10);
let localOnBeforeRequest = onBeforeRequest.bind();
- chrome.webRequest.onBeforeRequest.addListener(
+ browser.webRequest.onBeforeRequest.addListener(
localOnBeforeRequest,
{
urls: ["http://*/*", "https://*/*"],
types: ["main_frame"],
tabId: inspectedTabId
}
);
@@ -358,17 +358,17 @@
FilterNotifier.on("filter.added", onFilterAdded);
FilterNotifier.on("filter.removed", onFilterRemoved);
FilterNotifier.on("subscription.added", onSubscriptionAdded);
}
newPort.onDisconnect.addListener(() =>
{
panels.delete(inspectedTabId);
- chrome.webRequest.onBeforeRequest.removeListener(localOnBeforeRequest);
+ browser.webRequest.onBeforeRequest.removeListener(localOnBeforeRequest);
if (panels.size == 0)
{
ext.pages.onLoading.removeListener(onLoading);
FilterNotifier.off("filter.added", onFilterAdded);
FilterNotifier.off("filter.removed", onFilterRemoved);
FilterNotifier.off("subscription.added", onSubscriptionAdded);
}
« no previous file with comments | « lib/cssInjection.js ('k') | lib/filterComposer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld