From 19aea6a64c9c56d588b1b934154933167fd9856a Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 19 Oct 2024 17:08:48 +0800 Subject: feat: add simple contextMenu and background script --- addon/index.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'addon/index.mjs') 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 @@ +browser.runtime.onMessage.addListener((message, sender, sendResponse) => { + console.log('receive message', message) + sendResponse('received') + if (message === 'map-inline') { + alert('map') + return Promise.resolve('done') + } + return false +}) + const url = new URL(window.location) const use = url.searchParams.get('use') if (url.host === 'www.ptt.cc') { @@ -41,6 +51,6 @@ if (!document.querySelector('.Dumby')) { addBlocks, initialLayout: 'sticky', render: simpleRender, - autoMap: true, + autoMap: false, }) } -- cgit v1.2.3-70-g09d2