mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-04-22 07:58:01 +03:00
fix: partial save notification doesn't appear on firefox
This commit is contained in:
@@ -35,10 +35,10 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt
|
|||||||
const tabCount: number = tabs.length;
|
const tabCount: number = tabs.length;
|
||||||
|
|
||||||
tabs = tabs.filter(i =>
|
tabs = tabs.filter(i =>
|
||||||
i.url &&
|
i.url
|
||||||
!i.url.startsWith(browser.runtime.getURL("/")) &&
|
&& !i.url.startsWith(browser.runtime.getURL("/"))
|
||||||
new URL(i.url).protocol !== "about:" &&
|
&& new URL(i.url).protocol !== "about:"
|
||||||
new URL(i.url).hostname !== "newtab"
|
&& new URL(i.url).hostname !== "newtab"
|
||||||
);
|
);
|
||||||
|
|
||||||
const collection: CollectionItem = {
|
const collection: CollectionItem = {
|
||||||
@@ -49,6 +49,13 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt
|
|||||||
|
|
||||||
let tabIndex: number = 0;
|
let tabIndex: number = 0;
|
||||||
|
|
||||||
|
if (tabs.length < tabCount)
|
||||||
|
await sendNotification({
|
||||||
|
title: i18n.t("notifications.partial_save.title"),
|
||||||
|
message: i18n.t("notifications.partial_save.message"),
|
||||||
|
icon: "/notification_icons/save_warning.png"
|
||||||
|
});
|
||||||
|
|
||||||
if (tabs[tabIndex].pinned)
|
if (tabs[tabIndex].pinned)
|
||||||
{
|
{
|
||||||
collection.items.push({ type: "group", pinned: true, items: [] });
|
collection.items.push({ type: "group", pinned: true, items: [] });
|
||||||
@@ -123,12 +130,5 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tabs.length < tabCount)
|
|
||||||
await sendNotification({
|
|
||||||
title: i18n.t("notifications.partial_save.title"),
|
|
||||||
message: i18n.t("notifications.partial_save.message"),
|
|
||||||
icon: "/notification_icons/save_warning.png"
|
|
||||||
});
|
|
||||||
|
|
||||||
return [collection, tabs];
|
return [collection, tabs];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user