the extension as inteneded
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
|
||||
let anchor = document.getElementById('anchor');
|
||||
if (anchor) {
|
||||
window.fetch(anchor.innerText)
|
||||
.then(res => res.text())
|
||||
.then((body) => {
|
||||
document.body.textContent = "";
|
||||
document.body.innerHTML = body;
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
@@ -5,10 +5,9 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<button id="newtab">Open canvas</button>
|
||||
<button id="replacer">Load page</button>
|
||||
<button id="">On</button>
|
||||
<button id="">Off</button>
|
||||
<p id="output"></p>
|
||||
<script src="popup.js"></script>
|
||||
</body>
|
||||
<style>
|
||||
html {
|
||||
|
@@ -1,21 +0,0 @@
|
||||
const output = document.getElementById('output');
|
||||
let page_url = "http://127.0.0.1:4433/s3/style.css";
|
||||
|
||||
document.getElementById("newtab").addEventListener('click', async function(e) {
|
||||
browser.tabs.create({ url: "/main/main.html" }).then((t) => {
|
||||
if (t.id) {
|
||||
output.innerText += t.id
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
document.getElementById("replacer").addEventListener('click', async function(e) {
|
||||
browser.tabs.executeScript({ code: injection })
|
||||
browser.tabs.executeScript({ file: "inject.js" });
|
||||
})
|
||||
|
||||
|
||||
const injection = `
|
||||
let head = document.getElementById('anchor');
|
||||
head.innerText = "${page_url}";
|
||||
`
|
Reference in New Issue
Block a user