Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
url = https://git.torproject.org/translation.git
branch = https_everywhere

[submodule "https-everywhere-lib"]
path = https-everywhere-lib
url = https://github.com/EFForg/https-everywhere-lib.git
[submodule "lib-wasm"]
path = lib-wasm
url = https://github.com/EFForg/https-everywhere-lib-wasm.git
2 changes: 1 addition & 1 deletion chromium/background-scripts/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ RuleSets.prototype = {
this.store = store;
this.ruleActiveStates = await this.store.get_promise('ruleActiveStates', {});
try {
this.wasm_rs = wasm.RuleSets.new();
this.wasm_rs = wasm.JsRuleSets.new();
} catch(e) {
util.log(util.WARN, 'Falling back to pure JS implementation: ' + e);
}
Expand Down
6 changes: 3 additions & 3 deletions chromium/background-scripts/wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
(function(exports) {

const util = require('./util'),
{ RuleSets } = wasm_bindgen;
{ JsRuleSets } = wasm_bindgen;

async function initialize() {
try {
await wasm_bindgen(chrome.runtime.getURL('wasm/https_everywhere_lib_bg.wasm'));
await wasm_bindgen(chrome.runtime.getURL('wasm/https_everywhere_lib_wasm_bg.wasm'));
} catch(e) {
util.log(util.WARN, 'The wasm library has not loaded correctly: ' + e);
}
Expand All @@ -19,7 +19,7 @@ function is_enabled() {

Object.assign(exports, {
initialize,
RuleSets,
JsRuleSets,
is_enabled,
});

Expand Down
2 changes: 1 addition & 1 deletion chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": [
"background-scripts/bootstrap.js",
"background-scripts/util.js",
"wasm/https_everywhere_lib.js",
"wasm/https_everywhere_lib_wasm.js",
"background-scripts/wasm.js",
"background-scripts/update_channels.js",
"background-scripts/update.js",
Expand Down
2 changes: 1 addition & 1 deletion chromium/test/rules_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const text_encoding = require('text-encoding');
global.TextDecoder = text_encoding.TextDecoder;
global.TextEncoder = text_encoding.TextEncoder;
global.self = global;
require("../../https-everywhere-lib/pkg/https_everywhere_lib.js");
require("../../lib-wasm/pkg/https_everywhere_lib_wasm.js");

const assert = require('chai').assert,
rules = require('../background-scripts/rules');
Expand Down
1 change: 0 additions & 1 deletion https-everywhere-lib
Submodule https-everywhere-lib deleted from 58d40d
1 change: 1 addition & 0 deletions lib-wasm
Submodule lib-wasm added at a61606
4 changes: 2 additions & 2 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ do_not_ship="*.py *.xml"
rm -f $do_not_ship

mkdir wasm
cp ../../https-everywhere-lib/pkg/*.wasm wasm
cp ../../https-everywhere-lib/pkg/*.js wasm
cp ../../lib-wasm/pkg/*.wasm wasm
cp ../../lib-wasm/pkg/*.js wasm

cd ../..

Expand Down