diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-19 19:28:44 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-19 19:28:44 +0800 |
commit | 98abf3b460f25050045fb191c5e61f06a4f44c56 (patch) | |
tree | b66fda5b89b8fe0340de4370199b967751dd01f1 /addon/index.mjs | |
parent | 3f64a0673f5472d4cdb8aeec7c1a39f4b582c6c8 (diff) | |
parent | 19aea6a64c9c56d588b1b934154933167fd9856a (diff) |
Merge branch 'addon'
Diffstat (limited to 'addon/index.mjs')
-rw-r--r-- | addon/index.mjs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/addon/index.mjs b/addon/index.mjs index 5776a18..b9fc349 100644 --- a/addon/index.mjs +++ b/addon/index.mjs | |||
@@ -1,3 +1,13 @@ | |||
1 | browser.runtime.onMessage.addListener((message, sender, sendResponse) => { | ||
2 | console.log('receive message', message) | ||
3 | sendResponse('received') | ||
4 | if (message === 'map-inline') { | ||
5 | alert('map') | ||
6 | return Promise.resolve('done') | ||
7 | } | ||
8 | return false | ||
9 | }) | ||
10 | |||
1 | const url = new URL(window.location) | 11 | const url = new URL(window.location) |
2 | const use = url.searchParams.get('use') | 12 | const use = url.searchParams.get('use') |
3 | if (url.host === 'www.ptt.cc') { | 13 | if (url.host === 'www.ptt.cc') { |
@@ -41,6 +51,6 @@ if (!document.querySelector('.Dumby')) { | |||
41 | addBlocks, | 51 | addBlocks, |
42 | initialLayout: 'sticky', | 52 | initialLayout: 'sticky', |
43 | render: simpleRender, | 53 | render: simpleRender, |
44 | autoMap: true, | 54 | autoMap: false, |
45 | }) | 55 | }) |
46 | } | 56 | } |