aboutsummaryrefslogtreecommitdiffhomepage
path: root/addon/index.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-19 19:28:44 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-19 19:28:44 +0800
commit98abf3b460f25050045fb191c5e61f06a4f44c56 (patch)
treeb66fda5b89b8fe0340de4370199b967751dd01f1 /addon/index.mjs
parent3f64a0673f5472d4cdb8aeec7c1a39f4b582c6c8 (diff)
parent19aea6a64c9c56d588b1b934154933167fd9856a (diff)
Merge branch 'addon'
Diffstat (limited to 'addon/index.mjs')
-rw-r--r--addon/index.mjs12
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 @@
1browser.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
1const url = new URL(window.location) 11const url = new URL(window.location)
2const use = url.searchParams.get('use') 12const use = url.searchParams.get('use')
3if (url.host === 'www.ptt.cc') { 13if (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}