Skip to content

Commit 90d757c

Browse files
committed
feat(chrome-extension): enable larkenterprise.com (#70)
1 parent 910e8fd commit 90d757c

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

.changeset/lucky-squids-search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@dolphin/chrome-extension': patch
3+
---
4+
5+
enable larkenterprise.com (#70)

apps/chrome-extension/manifest.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"https://*.feishu.net/*",
2424
"https://*.larksuite.com/*",
2525
"https://*.feishu-pre.net/*",
26-
"https://*.larkoffice.com/*"
26+
"https://*.larkoffice.com/*",
27+
"https://*.larkenterprise.com/*"
2728
],
2829
"content_scripts": [
2930
{
@@ -32,7 +33,8 @@
3233
"https://*.feishu.net/*",
3334
"https://*.larksuite.com/*",
3435
"https://*.feishu-pre.net/*",
35-
"https://*.larkoffice.com/*"
36+
"https://*.larkoffice.com/*",
37+
"https://*.larkenterprise.com/*"
3638
],
3739
"js": ["bundles/content.js"],
3840
"run_at": "document_end"

apps/chrome-extension/src/background.ts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import { type Message } from './common/message'
22

3+
const sharedDocumentUrlPatterns: string[] = [
4+
'https://*.feishu.cn/*',
5+
'https://*.feishu.net/*',
6+
'https://*.larksuite.com/*',
7+
'https://*.feishu-pre.net/*',
8+
'https://*.larkoffice.com/*',
9+
'https://*.larkenterprise.com/*',
10+
]
11+
312
enum MenuItemId {
413
DOWNLOAD_DOCX_AS_MARKDOWN = 'download_docx_as_markdown',
514
COPY_DOCX_AS_MARKDOWN = 'copy_docx_as_markdown',
@@ -10,39 +19,21 @@ chrome.runtime.onInstalled.addListener(() => {
1019
chrome.contextMenus.create({
1120
id: MenuItemId.DOWNLOAD_DOCX_AS_MARKDOWN,
1221
title: chrome.i18n.getMessage('download_docx_as_markdown'),
13-
documentUrlPatterns: [
14-
'https://*.feishu.cn/*',
15-
'https://*.feishu.net/*',
16-
'https://*.larksuite.com/*',
17-
'https://*.feishu-pre.net/*',
18-
'https://*.larkoffice.com/*',
19-
],
22+
documentUrlPatterns: sharedDocumentUrlPatterns,
2023
contexts: ['page', 'editable'],
2124
})
2225

2326
chrome.contextMenus.create({
2427
id: MenuItemId.COPY_DOCX_AS_MARKDOWN,
2528
title: chrome.i18n.getMessage('copy_docx_as_markdown'),
26-
documentUrlPatterns: [
27-
'https://*.feishu.cn/*',
28-
'https://*.feishu.net/*',
29-
'https://*.larksuite.com/*',
30-
'https://*.feishu-pre.net/*',
31-
'https://*.larkoffice.com/*',
32-
],
29+
documentUrlPatterns: sharedDocumentUrlPatterns,
3330
contexts: ['page', 'editable'],
3431
})
3532

3633
chrome.contextMenus.create({
3734
id: MenuItemId.VIEW_DOCX_AS_MARKDOWN,
3835
title: chrome.i18n.getMessage('view_docx_as_markdown'),
39-
documentUrlPatterns: [
40-
'https://*.feishu.cn/*',
41-
'https://*.feishu.net/*',
42-
'https://*.larksuite.com/*',
43-
'https://*.feishu-pre.net/*',
44-
'https://*.larkoffice.com/*',
45-
],
36+
documentUrlPatterns: sharedDocumentUrlPatterns,
4637
contexts: ['page', 'editable'],
4738
})
4839
})

0 commit comments

Comments
 (0)