File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed
Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 1919 " Echart" ,
2020 " cond" ,
2121 " daterange" ,
22+ " dkdhhcbjijekmneelocdllcldcpmekmm" ,
23+ " fepjgblalcnepokjblgbgmapmlkgfahc" ,
2224 " emsp" ,
2325 " ensp"
2426 ]
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { getLatestVersion } from "@src/api/version"
99import packageInfo from "@src/package"
1010import { t } from "@popup/locale"
1111import { UPDATE_PAGE } from "@util/constant/url"
12- import { IS_FIREFOX } from "@util/constant/environment"
12+ import { IS_FIREFOX , IS_FROM_STORE } from "@util/constant/environment"
1313
1414function showUpgradeButton ( latestVersion : string ) {
1515 const upgrade = document . getElementById ( 'upgrade-container' )
@@ -34,4 +34,10 @@ function showUpgradeButton(latestVersion: string) {
3434 }
3535}
3636
37- getLatestVersion ( ) . then ( latestVersion => latestVersion && packageInfo . version !== latestVersion && showUpgradeButton ( latestVersion ) )
37+ getLatestVersion ( )
38+ . then ( latestVersion => latestVersion
39+ && packageInfo . version !== latestVersion
40+ // Must from store
41+ && IS_FROM_STORE
42+ && showUpgradeButton ( latestVersion )
43+ )
Original file line number Diff line number Diff line change 55 * https://opensource.org/licenses/MIT
66 */
77
8+ import { CHROME_ID , EDGE_ID , FIREFOX_ID } from "./meta"
9+
810const { userAgent } = navigator
911let isFirefox = false
1012let isChrome = false
@@ -33,3 +35,12 @@ export const IS_CHROME: boolean = isChrome
3335 * @since 0.8.0
3436 */
3537export const IS_OPERA : boolean = isOpera
38+
39+ const id = chrome . runtime . id
40+
41+ /**
42+ * @since 0.9.6
43+ */
44+ export const IS_FROM_STORE = ( isChrome && id === CHROME_ID )
45+ || ( isEdge && id === EDGE_ID )
46+ || ( isFirefox && id === FIREFOX_ID )
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) 2022 Hengyang Zhang
3+ *
4+ * This software is released under the MIT License.
5+ * https://opensource.org/licenses/MIT
6+ */
7+
8+ /**
9+ * @since 0.9.6
10+ */
11+ export const CHROME_ID = "dkdhhcbjijekmneelocdllcldcpmekmm"
12+
13+ /**
14+ * @since 0.9.6
15+ */
16+ export const FIREFOX_ID = "{a8cf72f7-09b7-4cd4-9aaa-7a023bf09916}"
17+
18+ /**
19+ * @since 0.9.6
20+ */
21+ export const EDGE_ID = "fepjgblalcnepokjblgbgmapmlkgfahc"
You can’t perform that action at this time.
0 commit comments