mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-24 19:33:01 +01:00
add new advanced setting to disable use of WASM for dev purpose
This commit is contained in:
parent
7831c094fc
commit
2189f020df
@ -44,8 +44,9 @@ const µBlock = (function() { // jshint ignore:line
|
|||||||
autoUpdatePeriod: 7,
|
autoUpdatePeriod: 7,
|
||||||
benchmarkingPane: false,
|
benchmarkingPane: false,
|
||||||
cacheStorageCompression: true,
|
cacheStorageCompression: true,
|
||||||
debugScriptlets: false,
|
|
||||||
cacheControlForFirefox1376932: 'no-cache, no-store, must-revalidate',
|
cacheControlForFirefox1376932: 'no-cache, no-store, must-revalidate',
|
||||||
|
debugScriptlets: false,
|
||||||
|
disableWebAssembly: false,
|
||||||
ignoreRedirectFilters: false,
|
ignoreRedirectFilters: false,
|
||||||
ignoreScriptInjectFilters: false,
|
ignoreScriptInjectFilters: false,
|
||||||
manualUpdateAssetFetchPeriod: 500,
|
manualUpdateAssetFetchPeriod: 500,
|
||||||
|
@ -467,6 +467,15 @@ const hnTrieManager = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Soft-dependency on µBlock's advanced settings so that the code here can
|
||||||
|
// be used outside of uBO (i.e. tests, benchmarks)
|
||||||
|
if (
|
||||||
|
typeof µBlock === 'object' &&
|
||||||
|
µBlock.hiddenSettings.disableWebAssembly === true
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// The wasm module will work only if CPU is natively little-endian,
|
// The wasm module will work only if CPU is natively little-endian,
|
||||||
// as we use native uint32 array in our trie-creation js code.
|
// as we use native uint32 array in our trie-creation js code.
|
||||||
const uint32s = new Uint32Array(1);
|
const uint32s = new Uint32Array(1);
|
||||||
|
@ -52,7 +52,11 @@ let init = function() {
|
|||||||
return Promise.resolve(lz4CodecInstance);
|
return Promise.resolve(lz4CodecInstance);
|
||||||
}
|
}
|
||||||
if ( pendingInitialization === undefined ) {
|
if ( pendingInitialization === undefined ) {
|
||||||
pendingInitialization = lz4BlockCodec.createInstance()
|
let flavor;
|
||||||
|
if ( µBlock.hiddenSettings.disableWebAssembly === true ) {
|
||||||
|
flavor = 'js';
|
||||||
|
}
|
||||||
|
pendingInitialization = lz4BlockCodec.createInstance(flavor)
|
||||||
.then(instance => {
|
.then(instance => {
|
||||||
lz4CodecInstance = instance;
|
lz4CodecInstance = instance;
|
||||||
pendingInitialization = undefined;
|
pendingInitialization = undefined;
|
||||||
|
@ -186,6 +186,7 @@
|
|||||||
vAPI.localStorage.setItem(
|
vAPI.localStorage.setItem(
|
||||||
'immediateHiddenSettings',
|
'immediateHiddenSettings',
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
|
disableWebAssembly: this.hiddenSettings.disableWebAssembly,
|
||||||
suspendTabsUntilReady: this.hiddenSettings.suspendTabsUntilReady,
|
suspendTabsUntilReady: this.hiddenSettings.suspendTabsUntilReady,
|
||||||
userResourcesLocation: this.hiddenSettings.userResourcesLocation
|
userResourcesLocation: this.hiddenSettings.userResourcesLocation
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user