Index: background.js |
=================================================================== |
--- a/background.js |
+++ b/background.js |
@@ -12,46 +12,17 @@ |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
"use strict"; |
-const {RegExpFilter} = require("filterClasses"); |
-const {ElemHide} = require("elemHide"); |
-const {checkWhitelisted} = require("whitelisting"); |
-const {extractHostFromFrame} = require("url"); |
const {port} = require("messaging"); |
-const devtools = require("devtools"); |
- |
-port.on("get-selectors", (msg, sender) => |
-{ |
- let selectors; |
- let trace = devtools && devtools.hasPanel(sender.page); |
- |
- if (!checkWhitelisted(sender.page, sender.frame, |
- RegExpFilter.typeMap.DOCUMENT | |
- RegExpFilter.typeMap.ELEMHIDE)) |
- { |
- let specificOnly = checkWhitelisted(sender.page, sender.frame, |
- RegExpFilter.typeMap.GENERICHIDE); |
- selectors = ElemHide.getSelectorsForDomain( |
- extractHostFromFrame(sender.frame), |
- specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING |
- ); |
- } |
- else |
- { |
- selectors = []; |
- } |
- |
- return {selectors, trace}; |
-}); |
port.on("forward", (msg, sender) => |
{ |
let targetPage; |
if (msg.targetPageId) |
targetPage = ext.getPage(msg.targetPageId); |
else |
targetPage = sender.page; |