-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.js
More file actions
1 lines (1 loc) · 771 Bytes
/
Copy pathhandler.js
File metadata and controls
1 lines (1 loc) · 771 Bytes
1
const start=document.getElementById("start"),enable=document.getElementById("enable"),preview=document.getElementById("preview");chrome.storage.sync.get(["domSelectorAutoEnable","domSelectorShowPreview"],(function(e){e.domSelectorAutoEnable&&!0===e.domSelectorAutoEnable&&(enable.checked=!0),e.domSelectorShowPreview&&!0===e.domSelectorShowPreview&&(preview.checked=!0)})),start.addEventListener("click",(function(e){chrome.tabs.query({active:!0,currentWindow:!0},e=>{chrome.tabs.sendMessage(e[0].id,{start:"true"},()=>{}),window.close()})})),enable.addEventListener("change",(function(e){chrome.storage.sync.set({domSelectorAutoEnable:!!this.checked})})),preview.addEventListener("change",(function(e){chrome.storage.sync.set({domSelectorShowPreview:!!this.checked})}));