Skip to content

Commit a479e73

Browse files
committed
Add browser polyfill, almost working
Not sure how to work past the fact that it seems Chrome is not respecting the unlimitedStorage manifest permission. If I can't store decompressed filters, the Chrome port is a dead-end.
1 parent 9637409 commit a479e73

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ EXTENSION_FILES = manifest.json \
5252
bloom.wasm \
5353
bloom-wrap.js \
5454
add-latest.js \
55+
browser-polyfill.js \
56+
browser-polyfill.js.map \
5557
icons
5658

5759
hackernews-button.zip: $(EXTENSION_FILES)
@@ -84,6 +86,12 @@ browser-polyfill.js.map:
8486
--output "$@" \
8587
"https://unpkg.com/webextension-polyfill@0.7.0/dist/browser-polyfill.js.map"
8688

89+
.PHONY: chrome-debug
90+
chrome-debug: hackernews-button.zip
91+
mkdir -p ../hn-discussion-chrome
92+
rm -rf ../hn-discussion-chrome/*
93+
unzip $^ -d ../hn-discussion-chrome/
94+
8795

8896

8997
################################################################################

background.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<meta charset="utf-8">
55
<!--
66
NOTE: bloom-wrap.js must come before bloom.js, and both must come before
7-
background.js!
7+
background.js! The polyfill must come first, before any calls to the
8+
"browser" api are made.
89
-->
10+
<script type="text/javascript" src="browser-polyfill.js"></script>
911
<script type="text/javascript" src="bloom-wrap.js"></script>
1012
<script async type="text/javascript" src="bloom.js"></script>
1113
<script type="text/javascript" src="background.js"></script>

manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"*://news.ycombinator.com/*"
5959
],
6060
"js": [
61+
"browser-polyfill.js",
6162
"add-latest.js"
6263
]
6364
}],

0 commit comments

Comments
 (0)