Commit 536e8fed authored by Hubert Figuière's avatar Hubert Figuière

Fixed #53 - Update adblockpluscore dependency on next to hg:cdf04dd1024d git:b4651bb

parent 866b8ef1
Pipeline #76199741 failed with stages
_root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/
_self = buildtools/ensure_dependencies.py
buildtools = buildtools hg:0ebf8cd23b36 git:04d50e0
adblockpluscore = adblockpluscore hg:3c40e08b7eaa git:1ea9471
adblockpluscore = adblockpluscore hg:cdf04dd1024d git:b4651bb
adblockplusui = adblockplusui hg:bd03c7fd123e git:437d5cf
/*
* This file is part of Adblock Plus <https://adblockplus.org/>,
* Copyright (C) 2006-present eyeo GmbH
*
* Adblock Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* Adblock Plus is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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";
//
// XPCOM emulation
//
let ComponentsObject = {
interfaces:
{
nsITimer: {TYPE_REPEATING_SLACK: 0},
nsIInterfaceRequestor: null
},
classes:
{
"@mozilla.org/timer;1":
{
createInstance() { return new FakeTimer(); }
}
},
utils: {
import(resource)
{
let match = /^resource:\/\/gre\/modules\/(.+)\.jsm$/.exec(resource);
let resourceName = match && match[1];
if (resourceName && Cu.import.resources.has(resourceName))
return {[resourceName]: Cu.import.resources.get(resourceName)};
throw new Error(
"Attempt to import unknown JavaScript module " + resource
);
},
reportError(e)
{
console.error(e);
console.trace();
}
},
manager: null,
ID() { return null; }
};
const Cc = ComponentsObject.classes;
const Ci = ComponentsObject.interfaces;
const Cu = ComponentsObject.utils;
Cu.import.resources = new Map([
[
"XPCOMUtils",
{
generateQI() {}
}
],
[
"Services",
{
obs: {
addObserver() {},
removeObserver() {}
}
}
]
]);
function FakeTimer()
{
}
FakeTimer.prototype =
{
delay: 0,
callback: null,
initWithCallback(callback, delay)
{
this.callback = callback;
this.delay = delay;
this.scheduleTimeout();
},
scheduleTimeout()
{
setTimeout(() =>
{
try
{
this.callback();
}
catch (e)
{
Cu.reportError(e);
}
this.scheduleTimeout();
}, this.delay);
}
};
......@@ -20,9 +20,9 @@
"use strict";
const {RegExpFilter} = require("../adblockpluscore/lib/filterClasses");
const {ElemHide, createStyleSheet,
const {elemHide, createStyleSheet,
rulesFromStyleSheet} = require("../adblockpluscore/lib/elemHide");
const {ElemHideEmulation} = require("../adblockpluscore/lib/elemHideEmulation");
const {elemHideEmulation} = require("../adblockpluscore/lib/elemHideEmulation");
const {filterNotifier} = require("../adblockpluscore/lib/filterNotifier");
const {snippets, compileScript} = require("../adblockpluscore/lib/snippets");
const {checkWhitelisted} = require("./whitelisting");
......@@ -230,10 +230,10 @@ port.on("content.applyFilters", (message, sender) =>
{
let specificOnly = checkWhitelisted(sender.page, sender.frame, null,
RegExpFilter.typeMap.GENERICHIDE);
styleSheet = ElemHide.generateStyleSheetForDomain(docDomain, specificOnly,
styleSheet = elemHide.generateStyleSheetForDomain(docDomain, specificOnly,
trace, trace);
for (let filter of ElemHideEmulation.getRulesForDomain(docDomain))
for (let filter of elemHideEmulation.getRulesForDomain(docDomain))
emulatedPatterns.push({selector: filter.selector, text: filter.text});
}
}
......
......@@ -53,5 +53,11 @@ let Utils = exports.Utils = {
yield()
{
},
logError(e)
{
console.error(e);
console.trace();
}
};
......@@ -5,12 +5,10 @@ author = eyeo GmbH
backgroundScripts = polyfill.js
ext/common.js
ext/background.js
lib/compat.js
lib/adblockplus.js
testScripts = ../polyfill.js
../ext/common.js
../ext/background.js
../lib/compat.js
tests.js
options = options.html
browserAction =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment