Initial Sortierer

This commit is contained in:
bwe 2026-03-02 23:34:29 +01:00
parent 9a3edd4046
commit 1d32171e21
7 changed files with 119 additions and 0 deletions

18
extension/background.js Normal file
View file

@ -0,0 +1,18 @@
browser.tabs.onActivated.addListener((activeInfo) => {
browser.tabs.executeScript(tabId, {
code: 'document.documentElement.outerHTML'
}).then(result => {
const html = result[0];
fetch('http://localhost:3000/notify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ html })
}).catch(err => {
console.error('Error sending HTML:', err);
});
}).catch(err => {
console.error('Error fetching HTML:', err);
});
});

11
extension/manifest.json Normal file
View file

@ -0,0 +1,11 @@
{
"manifest_version": 2,
"name": "Firefox Tab Monitor",
"version": "1.0",
"permissions": [
"tabs"
],
"background": {
"scripts": ["background.js"],
"persistent": true
}