diff --git a/browser/icon.png b/browser/icon.png new file mode 100644 index 0000000..6b41a93 Binary files /dev/null and b/browser/icon.png differ diff --git a/browser/jsconfig.json b/browser/jsconfig.json new file mode 100644 index 0000000..e90bc9d --- /dev/null +++ b/browser/jsconfig.json @@ -0,0 +1,5 @@ +{ + "typeAcquisition": { + "include": ["firefox-webext-browser"] + } +} diff --git a/browser/main/main.html b/browser/main/main.html new file mode 100644 index 0000000..3809bab --- /dev/null +++ b/browser/main/main.html @@ -0,0 +1,16 @@ + + +
+ + +Here is some text
+old
+ + + \ No newline at end of file diff --git a/browser/main/script.js b/browser/main/script.js new file mode 100644 index 0000000..9fdd6ca --- /dev/null +++ b/browser/main/script.js @@ -0,0 +1,5 @@ +document.getElementById("changeme").innerText = "newer" + +window.fetch("http://127.0.0.1:9001").then((e) => { + console.log(e) +}) diff --git a/browser/main/style.css b/browser/main/style.css new file mode 100644 index 0000000..cab1b1f --- /dev/null +++ b/browser/main/style.css @@ -0,0 +1,4 @@ +html { + background: black; + color: white; +} \ No newline at end of file diff --git a/browser/manifest.json b/browser/manifest.json new file mode 100644 index 0000000..c1d8e0c --- /dev/null +++ b/browser/manifest.json @@ -0,0 +1,14 @@ +{ + "manifest_version": 2, + "name": "Viewer", + "version": "0.1", + "description": "Adds a red border to all webpages matching mozilla.org.", + "permissions": [ + "activeTab" + ], + "browser_action": { + "default_icon": "icon.png", + "default_title": "Click me!", + "default_popup": "popup/popup.html" + } +} \ No newline at end of file diff --git a/browser/popup/popup.html b/browser/popup/popup.html new file mode 100644 index 0000000..dd8094d --- /dev/null +++ b/browser/popup/popup.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/browser/popup/popup.js b/browser/popup/popup.js new file mode 100644 index 0000000..b5d8389 --- /dev/null +++ b/browser/popup/popup.js @@ -0,0 +1,3 @@ +document.getElementById("newtab").addEventListener('click', async function(e) { + await browser.tabs.create({ url: "/main/main.html" }) +}) \ No newline at end of file diff --git a/browser/popup/runner.js b/browser/popup/runner.js new file mode 100644 index 0000000..0eee102 --- /dev/null +++ b/browser/popup/runner.js @@ -0,0 +1,5 @@ +document.body.textContent = ""; + +let header = document.createElement("h1"); +header.textContent = "This page has been eaten"; +document.body.appendChild(header); diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..86f7f90 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "Bundler", + "target": "ES2022", + "jsx": "react", + "allowImportingTsExtensions": true, + "strictNullChecks": true, + "strictFunctionTypes": true + }, + "exclude": [ + "node_modules", + "**/node_modules/*" + ], + "typeAcquisition": {"include": ["firefox-webext-browser"]} +} \ No newline at end of file