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

Delta Between Two Patch Sets: lib/devtools.js

Issue 29417597: Issue 5161 - Use maps and sets where appropriate (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Address comments to Patch Set 1 Created May 4, 2017, 2:44 p.m.
Right Patch Set: Minor unrelated changes Created May 21, 2017, 10:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « ext/background.js ('k') | lib/popupBlocker.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 let match = newPort.name.match(/^devtools-(\d+)$/); 332 let match = newPort.name.match(/^devtools-(\d+)$/);
333 if (!match) 333 if (!match)
334 return; 334 return;
335 335
336 let inspectedTabId = parseInt(match[1], 10); 336 let inspectedTabId = parseInt(match[1], 10);
337 let localOnBeforeRequest = onBeforeRequest.bind(); 337 let localOnBeforeRequest = onBeforeRequest.bind();
338 338
339 chrome.webRequest.onBeforeRequest.addListener( 339 chrome.webRequest.onBeforeRequest.addListener(
340 localOnBeforeRequest, 340 localOnBeforeRequest,
341 { 341 {
342 urls: ["<all_urls>"], 342 urls: ["http://*/*", "https://*/*"],
343 types: ["main_frame"], 343 types: ["main_frame"],
344 tabId: inspectedTabId 344 tabId: inspectedTabId
345 } 345 }
346 ); 346 );
347 347
348 if (panels.size == 0) 348 if (panels.size == 0)
349 { 349 {
350 ext.pages.onLoading.addListener(onLoading); 350 ext.pages.onLoading.addListener(onLoading);
351 FilterNotifier.on("filter.added", onFilterAdded); 351 FilterNotifier.on("filter.added", onFilterAdded);
352 FilterNotifier.on("filter.removed", onFilterRemoved); 352 FilterNotifier.on("filter.removed", onFilterRemoved);
(...skipping 17 matching lines...) Expand all
370 panels.set(inspectedTabId, {port: newPort, records: []}); 370 panels.set(inspectedTabId, {port: newPort, records: []});
371 }); 371 });
372 372
373 port.on("devtools.traceElemHide", (message, sender) => 373 port.on("devtools.traceElemHide", (message, sender) =>
374 { 374 {
375 logHiddenElements( 375 logHiddenElements(
376 sender.page, message.selectors, message.filters, 376 sender.page, message.selectors, message.filters,
377 extractHostFromFrame(sender.frame) 377 extractHostFromFrame(sender.frame)
378 ); 378 );
379 }); 379 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld