SichtDerDinge_Sortierer/extension/background.js

19 lines
590 B
JavaScript
Raw Permalink Normal View History

2026-03-02 23:34:29 +01:00
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);
});
});