Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion background/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ async function updateViaHttp(apiKey, plId, data, origin) {
});
const text = await res.text();
if (typeof console !== 'undefined' && console.log) {
console.log('[Chrysalis] HTTP', res.status, plId, body, text.slice(0, 200));
const logBody = { ...body };
if (logBody.key) logBody.key = '[REDACTED]';
console.log('[Chrysalis] HTTP', res.status, plId, logBody, text.slice(0, 200));
}
if (!res.ok) {
return { success: false, error: `HTTP ${res.status}: ${text.slice(0, 150)}` };
Expand Down
6 changes: 4 additions & 2 deletions setup/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,10 @@
};

async function findMonarchTab() {
const tabs = await chrome.tabs.query({ url: MONARCH_ORIGIN + '/*' });
return tabs.length ? tabs[0] : null;
const tabs = await chrome.tabs.query({ url: MONARCH_ORIGINS.map((o) => o + '/*') });
if (!tabs.length) return null;
const sorted = [...tabs].sort((a, b) => (b.lastAccessed || 0) - (a.lastAccessed || 0));
return sorted[0] || null;
}

function isPLAppTab(url) {
Expand Down