Skip to content

Commit

Permalink
https://github.com/AdguardTeam/AdguardBrowserExtension/issues/374
Browse files Browse the repository at this point in the history
  • Loading branch information
atropnikov committed Nov 18, 2016
1 parent 52f8474 commit 7261fb3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 25 deletions.
3 changes: 3 additions & 0 deletions Extension/browser/chrome/lib/api/background-page.js
Expand Up @@ -301,6 +301,9 @@
},
setPopup: function () {
// Do nothing. Popup is already installed in manifest file
},
close: function () {
// Do nothing
}
};

Expand Down
10 changes: 4 additions & 6 deletions Extension/browser/firefox/lib/mobileMenu.js
Expand Up @@ -24,9 +24,7 @@ var MobileMenu = {

nativeMenuIds: Object.create(null),

init: function (UI) {

this.UI = UI;
init: function () {

adguard.windowsImpl.onUpdated.addListener(function (adgWin, domWin, event) {
if (event === 'ChromeWindowLoad') {
Expand Down Expand Up @@ -190,15 +188,15 @@ var MobileMenu = {
name: "Adguard",
icon: null
});
MobileMenu.createSubMenus(window, menuID);
this.createSubMenus(window, menuID);
},

/**
* @param window
*/
removeFromWindow: function (window) {
if (window in MobileMenu.nativeMenuIds) {
var menuId = MobileMenu.nativeMenuIds[window].main;
if (window in this.nativeMenuIds) {
var menuId = this.nativeMenuIds[window].main;
window.NativeWindow.menu.remove(menuId);
}
}
Expand Down
4 changes: 0 additions & 4 deletions Extension/browser/firefox/lib/prefs.js
Expand Up @@ -51,7 +51,6 @@ var Prefs = {
speedupStartup: function () {
return SimplePrefs.get('speedup_startup');
},
collapseByContentScript: true, // SimplePrefs.get('collapse_by_content_script'),
useGlobalStyleSheet: SimplePrefs.get('use_global_style_sheet'),

ICONS: {
Expand All @@ -71,13 +70,10 @@ var Prefs = {
};

var onPreferenceChanged = function (prefName) {
Prefs.collapseByContentScript = SimplePrefs.get('collapse_by_content_script');
Prefs.useGlobalStyleSheet = SimplePrefs.get('use_global_style_sheet');
EventNotifier.notifyListeners(EventNotifierTypes.CHANGE_PREFS, prefName);
};
SimplePrefs.addListener('collapse_by_content_script', onPreferenceChanged);
SimplePrefs.addListener('use_global_style_sheet', onPreferenceChanged);
unload.when(function () {
SimplePrefs.removeListener('collapse_by_content_script', onPreferenceChanged);
SimplePrefs.removeListener('use_global_style_sheet', onPreferenceChanged);
});
7 changes: 0 additions & 7 deletions Extension/browser/firefox/package.json
Expand Up @@ -18,13 +18,6 @@
"title": "Speedup startup",
"description": "Enables asynchronous filters initialization"
},
{
"type": "bool",
"name": "collapse_by_content_script",
"value": true,
"title": "Collapse by content script",
"description": "Enables asynchronous elements blocking by the content script"
},
{
"type": "bool",
"name": "use_global_style_sheet",
Expand Down
6 changes: 0 additions & 6 deletions Extension/lib/content-message-handler.js
Expand Up @@ -144,12 +144,6 @@ ContentMessageHandler.prototype = {
var block = webRequestService.checkWebSocketRequest(sender.tab, message.elementUrl, message.documentUrl);
return {block: block, requestId: message.requestId};
case 'processShouldCollapse':

if (!Prefs.collapseByContentScript) {
// In case of FF we may collapse nodes with nsiContentPolicy
return {collapse: false, requestId: message.requestId};
}

var collapse = webRequestService.processShouldCollapse(sender.tab, message.elementUrl, message.documentUrl, message.requestType);
return {collapse: collapse, requestId: message.requestId};
case 'processShouldCollapseMany':
Expand Down
3 changes: 1 addition & 2 deletions Extension/lib/pages/popup.js
Expand Up @@ -18,7 +18,6 @@
/* global $, PopupController */
var backgroundPage = adguard.backgroundPage.getWindow();
var antiBannerService = backgroundPage.antiBannerService;
var UI = backgroundPage.UI;
var uiService = backgroundPage.uiService;
var framesMap = backgroundPage.framesMap;
var filteringLog = backgroundPage.filteringLog;
Expand Down Expand Up @@ -96,7 +95,7 @@ $(document).ready(function () {
adguard.closePopup();
};
controller.openLink = function (url) {
UI.openTab(url);
uiService.openTab(url);
adguard.closePopup();
};
controller.openFilteringLog = function (tabId) {
Expand Down

0 comments on commit 7261fb3

Please sign in to comment.