-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (32 loc) · 852 Bytes
/
index.js
File metadata and controls
36 lines (32 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const path = require("path");
module.exports = function copyPageButtonPlugin(context, options = {}) {
const {
customStyles = {},
enabledActions = ['copy', 'view', 'chatgpt', 'claude', 'perplexity', 'gemini', 'mcp-copy', 'mcp-cursor', 'mcp-vscode'],
mcpServer = null,
...otherOptions
} = options;
return {
name: "copy-page-button-plugin",
getClientModules() {
return [path.resolve(__dirname, "./client.js")];
},
injectHtmlTags() {
return {
headTags: [
{
tagName: 'script',
innerHTML: `
window.__COPY_PAGE_BUTTON_OPTIONS__ = ${JSON.stringify({
customStyles,
enabledActions,
mcpServer,
...otherOptions
})};
`
}
]
};
},
};
};