Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/dylib/Patches/LittleDia/Extension.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
@" if (request.action !== 'promote' || !tab.url) return;\n"
@" const normal = await chrome.windows.getLastFocused({ windowTypes: ['normal'] }).catch(() => null);\n"
@" if (normal) {\n"
@" await chrome.tabs.create({ windowId: normal.id, url: tab.url, active: true });\n"
@" const moved = await chrome.tabs.move(tab.id, { windowId: normal.id, index: -1 }).catch(() => null);\n"
@" if (moved) await chrome.tabs.update(tab.id, { active: true });\n"
@" else await chrome.tabs.create({ windowId: normal.id, url: tab.url, active: true });\n"
@" await chrome.windows.update(normal.id, { focused: true });\n"
@" } else {\n"
@" await chrome.windows.create({ url: tab.url, focused: true });\n"
@" }\n"
@" await chrome.windows.remove(tab.windowId);\n"
@" await chrome.windows.remove(tab.windowId).catch(() => {});\n"
@"});\n";

// Chromium keeps an extension's worker from its first run, so a changed worker needs a new folder.
Expand Down
Loading