diff --git a/jest.setup.js b/jest.setup.js index 7fbd10c..51d5073 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -9,6 +9,7 @@ chrome.runtime.id = 'test-id'; Object.assign(global, { chrome, browser: chrome, + __TARGET__: 'chrome', }); Object.assign(global, { $, diff --git a/package.json b/package.json index 3cf49f2..4d94b52 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "link-map", "displayName": "Link Map", - "version": "1.0.7", + "version": "1.0.8", "browserslist": "Chrome >= 96", "description": "Vertical Tabs Sidebar, But In Tree Structure", "author": "Garin", diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 516926c..f1ae5e0 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -231,10 +231,10 @@ "message": "Locate Active Tab Node" }, "collapseAll": { - "message": "Expand All" + "message": "Collapse All" }, "expandAll": { - "message": "Collapse All" + "message": "Expand All" }, "activeOrOpen": { "message": "Active/Open" diff --git a/src/config/browser-adapter-config.ts b/src/config/browser-adapter-config.ts index 629de76..e98aa4b 100644 --- a/src/config/browser-adapter-config.ts +++ b/src/config/browser-adapter-config.ts @@ -7,3 +7,7 @@ export const getReviewUrl = () => { ? 'https://microsoftedge.microsoft.com/addons/detail/link-map/penpmngcolockpbmeeafkmbefjijbaej' : 'https://chrome.google.com/webstore/detail/link-map/jappgmhllahigjolfpgbjdfhciabdnde'; }; + +export const getNewTabUrl = () => { + return __TARGET__ === 'edge' ? 'edge://newtab/' : 'chrome://newtab/'; +}; diff --git a/src/tree/features/tab-master-tree/nodes/tab-node-operations.ts b/src/tree/features/tab-master-tree/nodes/tab-node-operations.ts index 2253340..6c049f0 100644 --- a/src/tree/features/tab-master-tree/nodes/tab-node-operations.ts +++ b/src/tree/features/tab-master-tree/nodes/tab-node-operations.ts @@ -2,13 +2,14 @@ import { escape } from 'lodash'; import log from 'loglevel'; import type { Tabs } from 'webextension-polyfill'; +import { getNewTabUrl } from '../../../../config/browser-adapter-config'; import { getFaviconUrl } from '../../../../utils'; import type { TreeData, TreeNode } from './nodes'; import { NodeUtils } from './utils'; import { WindowNodeOperations } from './window-node-operations'; type FancytreeNode = Fancytree.FancytreeNode; -const NEW_TAB_URL = 'chrome://newtab/'; +const NEW_TAB_URL = getNewTabUrl(); export interface TabData extends Tabs.Tab, TreeData { windowId: number;