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

Side by Side Diff: background.js

Issue 29371585: Issue 4783 - Drop Safari support [adblockplusui] (Closed)
Patch Set: Created Jan. 12, 2017, 9:55 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
« no previous file with comments | « README.md ('k') | firstRun.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 } 64 }
65 } 65 }
66 66
67 var params = { 67 var params = {
68 blockedURLs: "", 68 blockedURLs: "",
69 filterlistsReinitialized: false, 69 filterlistsReinitialized: false,
70 addSubscription: false, 70 addSubscription: false,
71 filterError: false, 71 filterError: false,
72 downloadStatus: "synchronize_ok", 72 downloadStatus: "synchronize_ok",
73 showNotificationUI: false, 73 showNotificationUI: false
74 safariContentBlocker: false
75 }; 74 };
76 updateFromURL(params); 75 updateFromURL(params);
77 76
78 var modules = {}; 77 var modules = {};
79 global.require = function(module) 78 global.require = function(module)
80 { 79 {
81 return modules[module]; 80 return modules[module];
82 }; 81 };
83 82
84 modules.utils = { 83 modules.utils = {
85 Utils: { 84 Utils: {
86 getDocLink: function(link) 85 getDocLink: function(link)
87 { 86 {
88 return "https://adblockplus.org/redirect?link=" + encodeURIComponent(lin k); 87 return "https://adblockplus.org/redirect?link=" + encodeURIComponent(lin k);
89 }, 88 },
90 get appLocale() 89 get appLocale()
91 { 90 {
92 return parent.ext.i18n.getMessage("@@ui_locale").replace(/_/g, "-"); 91 return parent.ext.i18n.getMessage("@@ui_locale").replace(/_/g, "-");
93 } 92 }
94 } 93 }
95 }; 94 };
96 95
97 modules.prefs = {Prefs: new EventEmitter()}; 96 modules.prefs = {Prefs: new EventEmitter()};
98 var prefs = { 97 var prefs = {
99 notifications_ignoredcategories: (params.showNotificationUI) ? ["*"] : [], 98 notifications_ignoredcategories: (params.showNotificationUI) ? ["*"] : [],
100 notifications_showui: params.showNotificationUI, 99 notifications_showui: params.showNotificationUI,
101 safari_contentblocker: false,
102 shouldShowBlockElementMenu: true, 100 shouldShowBlockElementMenu: true,
103 show_devtools_panel: true, 101 show_devtools_panel: true,
104 subscriptions_exceptionsurl: "https://easylist-downloads.adblockplus.org/exc eptionrules.txt" 102 subscriptions_exceptionsurl: "https://easylist-downloads.adblockplus.org/exc eptionrules.txt"
105 }; 103 };
106 Object.keys(prefs).forEach(function(key) 104 Object.keys(prefs).forEach(function(key)
107 { 105 {
108 Object.defineProperty(modules.prefs.Prefs, key, { 106 Object.defineProperty(modules.prefs.Prefs, key, {
109 get: function() 107 get: function()
110 { 108 {
111 return prefs[key]; 109 return prefs[key];
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 docDomain: "example.com" 466 docDomain: "example.com"
469 }, 467 },
470 filter: { 468 filter: {
471 text: "||example.com/some-annoying-popup$popup", 469 text: "||example.com/some-annoying-popup$popup",
472 whitelisted: false, 470 whitelisted: false,
473 userDefined: true, 471 userDefined: true,
474 subscription: null 472 subscription: null
475 } 473 }
476 }); 474 });
477 }); 475 });
478
479 if (params.safariContentBlocker)
480 {
481 global.safari = {
482 extension: {
483 setContentBlocker: function() {}
484 }
485 };
486 }
487 })(this); 476 })(this);
OLDNEW
« no previous file with comments | « README.md ('k') | firstRun.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld