Skip to content

Commit

Permalink
Remove hardcoded url
Browse files Browse the repository at this point in the history
  • Loading branch information
qwtel committed Apr 15, 2022
1 parent 941717c commit 894fb7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ wasm-pack: wasm-pack-build
patch: wasm-pack
@echo "---> Patching JavaScript glue code..."
patch -uN pkg/html_rewriter.js < patches/html_rewriter.js.patch
patch -uN pkg/html_rewriter.js < patches/remove_url.patch

dist: patch
@echo "---> Copying required files to root..."
Expand Down
11 changes: 11 additions & 0 deletions patches/remove_url.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- html_rewriter.js 2022-04-13 19:17:16.000000000 +0700
+++ html_rewriter_x.js 2022-04-15 10:50:01.000000000 +0700
@@ -819,7 +819,7 @@

async function init(input) {
if (typeof input === 'undefined') {
- input = new URL('html_rewriter_bg.wasm', import.meta.url);
+ throw new Error('Initializing html_rewriter needs input')
}
const imports = {};
imports.wbg = {};

0 comments on commit 894fb7f

Please sign in to comment.