11import { 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+
312enum 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