26
26
27
27
/******************************************************************************/
28
28
29
-
(( ) => {
29
+
{
30
+
// >>>>> start of local scope
30
31
31
32
/******************************************************************************/
32
33
/******************************************************************************/
@@ -65,32 +66,35 @@ const noopFunc = function(){};
65
66
66
67
/******************************************************************************/
67
68
68
-
vAPI.app = (function() {
69
-
let version = manifest.version;
70
-
let match = /(\d+\.\d+\.\d+)(?:\.(\d+))?/.exec(version);
71
-
if ( match && match[2] ) {
72
-
let v = parseInt(match[2], 10);
73
-
version = match[1] + (v < 100 ? 'b' + v : 'rc' + (v - 100));
74
-
}
75
-
76
-
return {
77
-
name: manifest.name.replace(/ dev\w+ build/, ''),
78
-
version: version
79
-
};
80
-
})();
81
-
82
-
/******************************************************************************/
69
+
vAPI.app = {
70
+
name: manifest.name.replace(/ dev\w+ build/, ''),
71
+
version: (( ) => {
72
+
let version = manifest.version;
73
+
const match = /(\d+\.\d+\.\d+)(?:\.(\d+))?/.exec(version);
74
+
if ( match && match[2] ) {
75
+
const v = parseInt(match[2], 10);
76
+
version = match[1] + (v < 100 ? 'b' + v : 'rc' + (v - 100));
77
+
}
78
+
return version;
79
+
})(),
83
80
84
-
vAPI.app.restart = function() {
85
-
chrome.runtime.reload();
81
+
restart: function() {
82
+
browser.runtime.reload();
83
+
},
86
84
};
87
85
86
+
// https://github.com/uBlockOrigin/uBlock-issues/issues/717
87
+
// Prevent the extensions from being restarted mid-session.
88
+
browser.runtime.onUpdateAvailable.addListener(( ) => {
89
+
void 0;
90
+
});
91
+
88
92
/******************************************************************************/
89
93
/******************************************************************************/
90
94
91
95
// chrome.storage.local.get(null, function(bin){ console.debug('%o', bin); });
92
96
93
-
vAPI.storage = chrome.storage.local;
97
+
vAPI.storage = browser.storage.local;
94
98
95
99
/******************************************************************************/
96
100
/******************************************************************************/
@@ -217,7 +221,7 @@ vAPI.browserSettings = (function() {
217
221
},
218
222
219
223
set: function(details) {
220
-
for ( var setting in details ) {
224
+
for ( const setting in details ) {
221
225
if ( details.hasOwnProperty(setting) === false ) {
222
226
continue;
223
227
}
@@ -1222,11 +1226,10 @@ vAPI.contextMenu = chrome.contextMenus && {
1222
1226
onMustUpdate: function() {},
1223
1227
setEntries: function(entries, callback) {
1224
1228
entries = entries || [];
1225
-
var n = Math.max(this._entries.length, entries.length),
1226
-
oldEntryId, newEntry;
1227
-
for ( var i = 0; i < n; i++ ) {
1228
-
oldEntryId = this._entries[i];
1229
-
newEntry = entries[i];
1229
+
let n = Math.max(this._entries.length, entries.length);
1230
+
for ( let i = 0; i < n; i++ ) {
1231
+
const oldEntryId = this._entries[i];
1232
+
const newEntry = entries[i];
1230
1233
if ( oldEntryId && newEntry ) {
1231
1234
if ( newEntry.id !== oldEntryId ) {
1232
1235
chrome.contextMenus.remove(oldEntryId);
@@ -1277,8 +1280,8 @@ vAPI.commands = chrome.commands;
1277
1280
1278
1281
vAPI.adminStorage = chrome.storage.managed && {
1279
1282
getItem: function(key, callback) {
1280
-
var onRead = function(store) {
1281
-
var data;
1283
+
const onRead = function(store) {
1284
+
let data;
1282
1285
if (
1283
1286
!chrome.runtime.lastError &&
1284
1287
typeof store === 'object' &&
@@ -1513,6 +1516,7 @@ vAPI.cloud = (function() {
1513
1516
/******************************************************************************/
1514
1517
/******************************************************************************/
1515
1518
1516
-
})();
1519
+
// <<<<< end of local scope
1520
+
}
1517
1521
1518
1522
/******************************************************************************/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4