Initial Sortierer
This commit is contained in:
parent
9a3edd4046
commit
1d32171e21
7 changed files with 119 additions and 0 deletions
18
extension/background.js
Normal file
18
extension/background.js
Normal 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
11
extension/manifest.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Firefox Tab Monitor",
|
||||
"version": "1.0",
|
||||
"permissions": [
|
||||
"tabs"
|
||||
],
|
||||
"background": {
|
||||
"scripts": ["background.js"],
|
||||
"persistent": true
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue