Skip to content

Commit

Permalink
Output more debuggable logs
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Dec 11, 2024
1 parent ccacbfd commit a114fab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions webextensions/resources/module/tab-preview-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,11 @@ try{
}
if (message.timestamp < lastTimestamp) {
if (message?.logging)
console.log(' => expired, give up to show/update preview');
console.log(`show tab preview(${message.previewTabId}): expired, give up to show/update preview `, message.timestamp);
return true;
}
if (message?.logging)
console.log(`show tab preview(${message.previewTabId}): invoked, let's show/update preview `, message.timestamp);
lastTimestamp = message.timestamp;
preparePanel();
updatePanel(message);
Expand All @@ -333,14 +335,16 @@ try{
(message.previewTabId &&
panel.dataset.tabId != message.previewTabId)) {
if (message?.logging)
console.log(' => already hidden, nothing to do');
console.log(`hide tab preview(${message.previewTabId}): already hidden, nothing to do `, message.timestamp);
return;
}
if (message.timestamp < lastTimestamp) {
if (message?.logging)
console.log(' => expired, give up to hide preview');
console.log(`hide tab preview(${message.previewTabId}): expired, give up to hide preview `, message.timestamp);
return true;
}
if (message?.logging)
console.log(`hide tab preview(${message.previewTabId}): invoked, let's hide preview `, message.timestamp);
lastTimestamp = message.timestamp;
panel.classList.remove('open');
return true;
Expand Down
4 changes: 2 additions & 2 deletions webextensions/sidebar/tab-preview-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ async function onTabSubstanceEnter(event) {
if (!event.target.tab)
return;

log(`onTabSubstanceEnter(${event.target.tab.id}}) start`);
log(`onTabSubstanceEnter(${event.target.tab.id}}) start `, startAt);

hoveringTabIds.add(event.target.tab.id);
const tooltipText = event.target.appliedTooltipText;
Expand Down Expand Up @@ -548,7 +548,7 @@ async function onTabSubstanceLeave(event) {
if (!event.target.tab) // the tab was closed while waiting
return;

log(`onTabSubstanceLeave(${event.target.tab.id}}) hide tab preview in ${targetTabId || 'sidebar'}`);
log(`onTabSubstanceLeave(${event.target.tab.id}}) hide tab preview in ${targetTabId || 'sidebar'} `, startAt);
sendTabPreviewMessage(targetTabId, {
type: 'treestyletab:hide-tab-preview',
previewTabId: event.target.tab.id,
Expand Down

0 comments on commit a114fab

Please sign in to comment.