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

Side by Side Diff: ext/background.js

Issue 29410607: Issue 5090 - Use user stylesheets for element hiding if possible (Closed)
Patch Set: Use feature detection Created May 18, 2017, 2:21 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 chrome.runtime.onMessage.addListener((message, rawSender, sendResponse) => 601 chrome.runtime.onMessage.addListener((message, rawSender, sendResponse) =>
602 { 602 {
603 let sender = {}; 603 let sender = {};
604 604
605 // Add "page" and "frame" if the message was sent by a content script. 605 // Add "page" and "frame" if the message was sent by a content script.
606 // If sent by popup or the background page itself, there is no "tab". 606 // If sent by popup or the background page itself, there is no "tab".
607 if ("tab" in rawSender) 607 if ("tab" in rawSender)
608 { 608 {
609 sender.page = new Page(rawSender.tab); 609 sender.page = new Page(rawSender.tab);
610 sender.frame = { 610 sender.frame = {
611 id: rawSender.frameId,
611 url: new URL(rawSender.url), 612 url: new URL(rawSender.url),
612 get parent() 613 get parent()
613 { 614 {
614 let frames = framesOfTabs[rawSender.tab.id]; 615 let frames = framesOfTabs[rawSender.tab.id];
615 616
616 if (!frames) 617 if (!frames)
617 return null; 618 return null;
618 619
619 let frame = frames[rawSender.frameId]; 620 let frame = frames[rawSender.frameId];
620 if (frame) 621 if (frame)
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 ext.windows = { 725 ext.windows = {
725 create(createData, callback) 726 create(createData, callback)
726 { 727 {
727 chrome.windows.create(createData, createdWindow => 728 chrome.windows.create(createData, createdWindow =>
728 { 729 {
729 afterTabLoaded(callback)(createdWindow.tabs[0]); 730 afterTabLoaded(callback)(createdWindow.tabs[0]);
730 }); 731 });
731 } 732 }
732 }; 733 };
733 }()); 734 }());
OLDNEW
« no previous file with comments | « background.js ('k') | include.preload.js » ('j') | include.preload.js » ('J')

Powered by Google App Engine
This is Rietveld