extension console logs only in debug mode
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const profileSelect = document.getElementById('profileSelect');
|
||||
const statusEl = document.getElementById('status');
|
||||
const debugToggle = document.getElementById('debugLoggingToggle');
|
||||
|
||||
function apiFetch(url, options = {}) {
|
||||
const config = {
|
||||
@@ -76,6 +77,19 @@ async function initProfileSelect() {
|
||||
|
||||
initProfileSelect();
|
||||
|
||||
chrome.storage.sync.get(['debugLoggingEnabled'], (result) => {
|
||||
const enabled = Boolean(result && result.debugLoggingEnabled);
|
||||
debugToggle.checked = enabled;
|
||||
});
|
||||
|
||||
debugToggle.addEventListener('change', () => {
|
||||
const enabled = debugToggle.checked;
|
||||
chrome.storage.sync.set({ debugLoggingEnabled: enabled }, () => {
|
||||
updateStatus(`Debug-Logging ${enabled ? 'aktiviert' : 'deaktiviert'}`, true);
|
||||
reloadFacebookTabs();
|
||||
});
|
||||
});
|
||||
|
||||
function reloadFacebookTabs() {
|
||||
chrome.tabs.query({ url: ['https://www.facebook.com/*', 'https://facebook.com/*'] }, (tabs) => {
|
||||
tabs.forEach(tab => {
|
||||
|
||||
Reference in New Issue
Block a user