Update webpack config

- write bundle to `/build`
- add support for SASS
- improve options view as a proof o concept for styling
This commit is contained in:
Manuel Bouza
2019-02-05 10:44:11 +01:00
parent 7c2b4fae5b
commit 388310eebb
22 changed files with 2550 additions and 86606 deletions

View File

@@ -1,19 +1,16 @@
import DomainCheck from './services/DomainCheck'
import DomainCheck from "./services/DomainCheck";
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
// inject files only after the page is fully loaded
if (changeInfo.status != 'complete') return
if (changeInfo.status != "complete") return;
// inject files only for supported websites
const domainCheck = new DomainCheck(tab.url)
if (!domainCheck.hasMatch) return
const domainCheck = new DomainCheck(tab.url);
if (!domainCheck.hasMatch) return;
// inject css + js
chrome.tabs.insertCSS(tabId, {file: "/styles.css"}, () => {
chrome.tabs.executeScript(tabId, {file: "/bubble.js"}, () => {
// chrome.tabs.executeScript(tabId, {file: "/popup.js"}, () => {
console.log("injected bubble.js")
// })
})
})
})
chrome.tabs.executeScript(tabId, { file: "/bubble.js" }, () => {
// chrome.tabs.executeScript(tabId, {file: "/popup.js"}, () => {
console.log("injected bubble.js");
// })
});
});