vg-coder-cli 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPMENT.md +95 -0
- package/README.md +19 -0
- package/SYSTEM_PROMPT.md +157 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +206 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +206 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/detectors/index.html +116 -0
- package/coverage/lcov-report/src/detectors/project-detector.js.html +1084 -0
- package/coverage/lcov-report/src/exporter/html-exporter.js.html +2839 -0
- package/coverage/lcov-report/src/exporter/index.html +116 -0
- package/coverage/lcov-report/src/ignore/ignore-manager.js.html +979 -0
- package/coverage/lcov-report/src/ignore/index.html +116 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.js.html +928 -0
- package/coverage/lcov-report/src/scanner/file-scanner.js.html +1903 -0
- package/coverage/lcov-report/src/scanner/index.html +116 -0
- package/coverage/lcov-report/src/tokenizer/index.html +116 -0
- package/coverage/lcov-report/src/tokenizer/token-manager.js.html +1252 -0
- package/coverage/lcov-report/src/utils/helpers.js.html +469 -0
- package/coverage/lcov-report/src/utils/index.html +116 -0
- package/coverage/lcov.info +1396 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/detectors/index.html +116 -0
- package/coverage/src/detectors/project-detector.js.html +1084 -0
- package/coverage/src/exporter/html-exporter.js.html +2839 -0
- package/coverage/src/exporter/index.html +116 -0
- package/coverage/src/ignore/ignore-manager.js.html +979 -0
- package/coverage/src/ignore/index.html +116 -0
- package/coverage/src/index.html +116 -0
- package/coverage/src/index.js.html +928 -0
- package/coverage/src/scanner/file-scanner.js.html +1903 -0
- package/coverage/src/scanner/index.html +116 -0
- package/coverage/src/tokenizer/index.html +116 -0
- package/coverage/src/tokenizer/token-manager.js.html +1252 -0
- package/coverage/src/utils/helpers.js.html +469 -0
- package/coverage/src/utils/index.html +116 -0
- package/jest.config.js +16 -0
- package/package.json +5 -3
- package/scripts/build.js +40 -0
- package/src/server/api-server.js +15 -0
- package/src/server/views/css/iframe.css +84 -0
- package/src/server/views/css/structure.css +63 -37
- package/src/server/views/dashboard.css +127 -310
- package/src/server/views/dashboard.html +165 -119
- package/src/server/views/js/features/iframe-manager.js +56 -0
- package/src/server/views/js/main.js +64 -0
- package/src/server/views/vg-coder/assets/icon128.png +0 -0
- package/src/server/views/vg-coder/assets/icon16.png +0 -0
- package/src/server/views/vg-coder/assets/icon48.png +0 -0
- package/src/server/views/vg-coder/background.js +2 -0
- package/src/server/views/vg-coder/background.js.LICENSE.txt +118 -0
- package/src/server/views/vg-coder/controller.js +1 -0
- package/src/server/views/vg-coder/manifest.json +58 -0
- package/src/server/views/vg-coder/options.css +164 -0
- package/src/server/views/vg-coder/options.html +48 -0
- package/src/server/views/vg-coder/options.js +1 -0
- package/src/server/views/vg-coder/rules.json +23 -0
- package/vg-coder-cli-2.0.11.tgz +0 -0
- package/vg-coder.zip +0 -0
- package/vg-coder-cli-2.0.8.tgz +0 -0
- package/vg-coder-cli-2.0.9.tgz +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2018 Google LLC
|
|
21
|
+
*
|
|
22
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
* you may not use this file except in compliance with the License.
|
|
24
|
+
* You may obtain a copy of the License at
|
|
25
|
+
*
|
|
26
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
+
*
|
|
28
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
+
* See the License for the specific language governing permissions and
|
|
32
|
+
* limitations under the License.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2019 Google LLC
|
|
38
|
+
*
|
|
39
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
40
|
+
* you may not use this file except in compliance with the License.
|
|
41
|
+
* You may obtain a copy of the License at
|
|
42
|
+
*
|
|
43
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
44
|
+
*
|
|
45
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
46
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
47
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
48
|
+
* See the License for the specific language governing permissions and
|
|
49
|
+
* limitations under the License.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright 2020 Google LLC
|
|
55
|
+
*
|
|
56
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
57
|
+
* you may not use this file except in compliance with the License.
|
|
58
|
+
* You may obtain a copy of the License at
|
|
59
|
+
*
|
|
60
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
61
|
+
*
|
|
62
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
63
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
64
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
65
|
+
* See the License for the specific language governing permissions and
|
|
66
|
+
* limitations under the License.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @license
|
|
71
|
+
* Copyright 2021 Google LLC
|
|
72
|
+
*
|
|
73
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
74
|
+
* you may not use this file except in compliance with the License.
|
|
75
|
+
* You may obtain a copy of the License at
|
|
76
|
+
*
|
|
77
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
78
|
+
*
|
|
79
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
80
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
81
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
82
|
+
* See the License for the specific language governing permissions and
|
|
83
|
+
* limitations under the License.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @license
|
|
88
|
+
* Copyright 2022 Google LLC
|
|
89
|
+
*
|
|
90
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
91
|
+
* you may not use this file except in compliance with the License.
|
|
92
|
+
* You may obtain a copy of the License at
|
|
93
|
+
*
|
|
94
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
95
|
+
*
|
|
96
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
97
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
98
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
99
|
+
* See the License for the specific language governing permissions and
|
|
100
|
+
* limitations under the License.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @license
|
|
105
|
+
* Copyright 2023 Google LLC
|
|
106
|
+
*
|
|
107
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
+
* you may not use this file except in compliance with the License.
|
|
109
|
+
* You may obtain a copy of the License at
|
|
110
|
+
*
|
|
111
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
+
*
|
|
113
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
+
* See the License for the specific language governing permissions and
|
|
117
|
+
* limitations under the License.
|
|
118
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function c(e){try{s(o.next(e))}catch(e){i(e)}}function a(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,a)}s((o=o.apply(e,t||[])).next())})};class t{static detectStrictCSP(){try{const e=document.querySelectorAll('meta[http-equiv="Content-Security-Policy"]');for(let t=0;t<e.length;t++){const n=e[t].getAttribute("content")||"";if(n.includes("script-src")&&!n.includes("blob:")&&!n.includes("data:"))return!0}const t=["midjourney.com","openai.com","github.com","google.com","googletagmanager.com","facebook.com","twitter.com","linkedin.com"],n=window.location.hostname.toLowerCase();return t.some(e=>n.includes(e))}catch(e){return console.error("CSP detection error:",e),!1}}static getHeadElement(){return new Promise(e=>{const t=()=>{const n=document.head||document.getElementsByTagName("head")[0];if(n)e(n);else if("loading"===document.readyState)document.addEventListener("DOMContentLoaded",t,{once:!0});else{const n=document.createElement("head");document.documentElement?(document.documentElement.appendChild(n),e(n)):setTimeout(t,100)}};t()})}static injectViaBlob(t,n){return e(this,void 0,void 0,function*(){try{const o=new Blob([t],{type:"application/javascript"}),r=URL.createObjectURL(o),i=document.createElement("script");return i.type="text/javascript",i.id=n,i.src=r,new Promise(t=>e(this,void 0,void 0,function*(){i.onload=()=>{URL.revokeObjectURL(r),t(!0)},i.onerror=()=>{URL.revokeObjectURL(r),t(!1)};try{(yield this.getHeadElement()).appendChild(i)}catch(e){console.error("Failed to get head element:",e),URL.revokeObjectURL(r),t(!1)}}))}catch(e){return console.error("Blob injection failed:",e),!1}})}static injectViaDataUrl(t,n){return e(this,void 0,void 0,function*(){try{const o="data:application/javascript;base64,"+btoa(t),r=document.createElement("script");return r.type="text/javascript",r.id=n+"_data",r.src=o,new Promise(t=>e(this,void 0,void 0,function*(){r.onload=()=>t(!0),r.onerror=()=>t(!1);try{(yield this.getHeadElement()).appendChild(r)}catch(e){console.error("Failed to get head element for data URL:",e),t(!1)}}))}catch(e){return console.error("Data URL injection failed:",e),!1}})}static injectViaPostMessage(e,t){return new Promise(n=>{try{const o="\n window.addEventListener('message', function(event) {\n if (event.source !== window || !event.data.type || event.data.type !== 'VETGO_SCRIPT_INJECT') {\n return;\n }\n try {\n const func = new Function(event.data.script);\n func();\n window.postMessage({type: 'VETGO_SCRIPT_SUCCESS', actionType: event.data.actionType}, '*');\n } catch (error) {\n console.error('PostMessage script execution failed:', error);\n window.postMessage({type: 'VETGO_SCRIPT_ERROR', actionType: event.data.actionType, error: error.message}, '*');\n }\n });\n ";this.injectViaBlob(o,t+"_bridge").then(o=>{if(o){const o=e=>{e.source===window&&e.data.type&&("VETGO_SCRIPT_SUCCESS"===e.data.type&&e.data.actionType===t?(window.removeEventListener("message",o),n(!0)):"VETGO_SCRIPT_ERROR"===e.data.type&&e.data.actionType===t&&(window.removeEventListener("message",o),n(!1)))};window.addEventListener("message",o),window.postMessage({type:"VETGO_SCRIPT_INJECT",script:e,actionType:t},"*"),setTimeout(()=>{window.removeEventListener("message",o),n(!1)},5e3)}else n(!1)})}catch(e){console.error("PostMessage injection failed:",e),n(!1)}})}static injectViaBackground(e,t){return new Promise(n=>{try{chrome.runtime.sendMessage({action:"INJECT_SCRIPT",script:e,actionType:t},e=>{chrome.runtime.lastError?(console.error("Background injection failed:",chrome.runtime.lastError),n(!1)):n(e&&e.success)})}catch(e){console.error("Background script injection failed:",e),n(!1)}})}static injectViaEval(e,t){return new Promise(n=>{try{console.log(`Attempting direct eval for ${t}`);n(new Function("script",`\n try {\n ${e}\n return true;\n } catch (error) {\n console.error('Eval execution error:', error);\n return false;\n }\n `)(e))}catch(e){console.error("Eval injection failed:",e),n(!1)}})}static injectScript(t,n){return e(this,void 0,void 0,function*(){const e=this.detectStrictCSP(),o=e?[()=>this.injectViaBackground(t,n),()=>this.injectViaEval(t,n),()=>this.injectViaPostMessage(t,n),()=>this.injectViaBlob(t,n),()=>this.injectViaDataUrl(t,n)]:[()=>this.injectViaBlob(t,n),()=>this.injectViaDataUrl(t,n),()=>this.injectViaBackground(t,n),()=>this.injectViaEval(t,n),()=>this.injectViaPostMessage(t,n)];console.log(`Injecting script for ${n} (Strict CSP: ${e})`);for(let t=0;t<o.length;t++){const r=o[t],i=e?["Background","Eval","PostMessage","Blob","DataURL"][t]:["Blob","DataURL","Background","Eval","PostMessage"][t];try{if(console.log(`Trying ${i} injection...`),yield r())return console.log(`✅ Script injection successful via ${i} for ${n}`),!0;console.log(`❌ ${i} injection failed for ${n}`)}catch(e){console.error(`❌ ${i} injection error:`,e)}}return console.error(`❌ All injection methods failed for ${n}`),!1})}}var n=function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function c(e){try{s(o.next(e))}catch(e){i(e)}}function a(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,a)}s((o=o.apply(e,t||[])).next())})};const o=(e,o)=>n(void 0,void 0,void 0,function*(){try{(yield t.injectScript(e,o))||console.error("All script injection methods failed for:",o)}catch(e){console.error("Script injection error:",e)}}),r=()=>new Promise(e=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>e(),{once:!0}):e()});n(void 0,void 0,void 0,function*(){try{yield r();const e=new URL(window.location.href).searchParams.get("actionType")||"MAIN",t=sessionStorage.getItem(e);t?yield o(t,e):chrome.runtime.sendMessage({action:"CONTROLLER",domain:window.location.hostname.replace(/(https?:\/\/)?(www.)?/i,""),actionType:e},t=>n(void 0,void 0,void 0,function*(){if(chrome.runtime.lastError)console.error("Runtime error:",chrome.runtime.lastError);else if(t&&t.script){const n=`var chromeId = "${chrome.runtime.id}"; ${t.script}`;yield o(n,e),sessionStorage.setItem(e,n)}}))}catch(e){console.error("Controller initialization error:",e)}}),n(void 0,void 0,void 0,function*(){try{yield r();const e=()=>new Promise(e=>{const t=()=>{const n=document.querySelector("body");n?e(n):setTimeout(t,100)};t()});(yield e()).addEventListener("REMOVE_EXTENSION",function(e){console.log(e.detail),chrome.runtime.sendMessage({action:"REMOVE_EXTENSION",data:e.detail},e=>{chrome.runtime.lastError?console.error("Runtime error:",chrome.runtime.lastError):console.log("tu huy thanh cong",e)})})}catch(e){console.error("Setup remove extension listener error:",e)}})})();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "VetGo Coder",
|
|
4
|
+
"short_name": "VetGoCoder",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "VetGo Copyright VetGo ",
|
|
7
|
+
"permissions": [
|
|
8
|
+
"management",
|
|
9
|
+
"webNavigation",
|
|
10
|
+
"notifications",
|
|
11
|
+
"cookies",
|
|
12
|
+
"storage",
|
|
13
|
+
"tabs",
|
|
14
|
+
"nativeMessaging",
|
|
15
|
+
"downloads",
|
|
16
|
+
"scripting",
|
|
17
|
+
"declarativeNetRequest"
|
|
18
|
+
],
|
|
19
|
+
"host_permissions": [
|
|
20
|
+
"<all_urls>"
|
|
21
|
+
],
|
|
22
|
+
"icons": {
|
|
23
|
+
"128": "assets/icon128.png",
|
|
24
|
+
"48": "assets/icon48.png",
|
|
25
|
+
"16": "assets/icon16.png"
|
|
26
|
+
},
|
|
27
|
+
"content_scripts": [
|
|
28
|
+
{
|
|
29
|
+
"matches": [
|
|
30
|
+
"<all_urls>"
|
|
31
|
+
],
|
|
32
|
+
"js": [
|
|
33
|
+
"controller.js"
|
|
34
|
+
],
|
|
35
|
+
"all_frames": true,
|
|
36
|
+
"run_at": "document_start"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"background": {
|
|
40
|
+
"service_worker": "background.js"
|
|
41
|
+
},
|
|
42
|
+
"content_security_policy": {
|
|
43
|
+
"extension_pages": "script-src 'self'; object-src 'self'"
|
|
44
|
+
},
|
|
45
|
+
"options_ui": {
|
|
46
|
+
"page": "options.html",
|
|
47
|
+
"open_in_tab": false
|
|
48
|
+
},
|
|
49
|
+
"declarative_net_request": {
|
|
50
|
+
"rule_resources": [
|
|
51
|
+
{
|
|
52
|
+
"id": "ruleset_1",
|
|
53
|
+
"enabled": true,
|
|
54
|
+
"path": "rules.json"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
* {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
body {
|
|
8
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
9
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
padding: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container {
|
|
18
|
+
background: white;
|
|
19
|
+
border-radius: 16px;
|
|
20
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
21
|
+
padding: 40px;
|
|
22
|
+
max-width: 500px;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
h1 {
|
|
27
|
+
color: #333;
|
|
28
|
+
font-size: 28px;
|
|
29
|
+
margin-bottom: 10px;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.subtitle {
|
|
34
|
+
color: #666;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
margin-bottom: 30px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.form-group {
|
|
40
|
+
margin-bottom: 24px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
label {
|
|
44
|
+
display: block;
|
|
45
|
+
color: #444;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
margin-bottom: 8px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
input[type="text"] {
|
|
52
|
+
width: 100%;
|
|
53
|
+
padding: 12px 16px;
|
|
54
|
+
border: 2px solid #e0e0e0;
|
|
55
|
+
border-radius: 8px;
|
|
56
|
+
font-size: 15px;
|
|
57
|
+
transition: all 0.3s ease;
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
input[type="text"]:focus {
|
|
62
|
+
border-color: #667eea;
|
|
63
|
+
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.hint {
|
|
67
|
+
color: #888;
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
margin-top: 6px;
|
|
70
|
+
font-style: italic;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.button-group {
|
|
74
|
+
display: flex;
|
|
75
|
+
gap: 12px;
|
|
76
|
+
margin-top: 30px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
button {
|
|
80
|
+
flex: 1;
|
|
81
|
+
padding: 12px 24px;
|
|
82
|
+
border: none;
|
|
83
|
+
border-radius: 8px;
|
|
84
|
+
font-size: 15px;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
transition: all 0.3s ease;
|
|
88
|
+
outline: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.btn-primary {
|
|
92
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
93
|
+
color: white;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.btn-primary:hover {
|
|
97
|
+
transform: translateY(-2px);
|
|
98
|
+
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.btn-primary:active {
|
|
102
|
+
transform: translateY(0);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.btn-secondary {
|
|
106
|
+
background: #f5f5f5;
|
|
107
|
+
color: #666;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.btn-secondary:hover {
|
|
111
|
+
background: #e0e0e0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.message {
|
|
115
|
+
padding: 12px 16px;
|
|
116
|
+
border-radius: 8px;
|
|
117
|
+
margin-bottom: 20px;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
display: none;
|
|
120
|
+
animation: slideIn 0.3s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes slideIn {
|
|
124
|
+
from {
|
|
125
|
+
opacity: 0;
|
|
126
|
+
transform: translateY(-10px);
|
|
127
|
+
}
|
|
128
|
+
to {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
transform: translateY(0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.message.success {
|
|
135
|
+
background: #d4edda;
|
|
136
|
+
color: #155724;
|
|
137
|
+
border: 1px solid #c3e6cb;
|
|
138
|
+
display: block;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.message.error {
|
|
142
|
+
background: #f8d7da;
|
|
143
|
+
color: #721c24;
|
|
144
|
+
border: 1px solid #f5c6cb;
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.current-value {
|
|
149
|
+
background: #f8f9fa;
|
|
150
|
+
padding: 12px 16px;
|
|
151
|
+
border-radius: 8px;
|
|
152
|
+
margin-bottom: 20px;
|
|
153
|
+
border-left: 4px solid #667eea;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.current-value strong {
|
|
157
|
+
color: #667eea;
|
|
158
|
+
font-weight: 600;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.current-value span {
|
|
162
|
+
color: #333;
|
|
163
|
+
font-family: 'Courier New', monospace;
|
|
164
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="vi">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>VetGo Pro - Cấu hình</title>
|
|
8
|
+
<link rel="stylesheet" href="options.css">
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<div class="container">
|
|
13
|
+
<h1>⚙️ Cấu hình VetGo Pro</h1>
|
|
14
|
+
<p class="subtitle">Quản lý cài đặt môi trường cho extension</p>
|
|
15
|
+
|
|
16
|
+
<div id="message" class="message"></div>
|
|
17
|
+
|
|
18
|
+
<div class="current-value">
|
|
19
|
+
<strong>Môi trường hiện tại:</strong> <span id="currentEnv">Đang tải...</span>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<form id="configForm">
|
|
23
|
+
<div class="form-group">
|
|
24
|
+
<label for="environmentName">Tên môi trường (Environment Name)</label>
|
|
25
|
+
<input type="text" id="environmentName" name="environmentName"
|
|
26
|
+
placeholder="Nhập tên môi trường (ví dụ: midjourney, production, test)" required />
|
|
27
|
+
<p class="hint">Tên môi trường sẽ được sử dụng để load scripts từ Firebase: ENV/{environmentName}/script</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="form-group">
|
|
31
|
+
<label for="firebaseConfig">Cấu hình Firebase (JSON)</label>
|
|
32
|
+
<textarea id="firebaseConfig" name="firebaseConfig" rows="8"
|
|
33
|
+
placeholder='{"apiKey": "...", "authDomain": "...", "databaseURL": "..."}'
|
|
34
|
+
style="width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-family: monospace; font-size: 13px;"></textarea>
|
|
35
|
+
<p class="hint">Để trống để sử dụng cấu hình mặc định của hệ thống. Nhập JSON object chứa apiKey, authDomain, databaseURL...</p>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="button-group">
|
|
39
|
+
<button type="submit" class="btn-primary">💾 Lưu cấu hình</button>
|
|
40
|
+
<button type="button" id="resetBtn" class="btn-secondary">🔄 Đặt lại mặc định</button>
|
|
41
|
+
</div>
|
|
42
|
+
</form>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<script src="options.js"></script>
|
|
46
|
+
</body>
|
|
47
|
+
|
|
48
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";const e={apiKey:"AIzaSyDrpNMso-DXeN7c4vwbpV0idpxnV2vtXhQ",authDomain:"vetgo-chrome.firebaseapp.com",databaseURL:"https://vetgo-chrome-default-rtdb.asia-southeast1.firebasedatabase.app",projectId:"vetgo-chrome",storageBucket:"vetgo-chrome.appspot.com",messagingSenderId:"211178224097",appId:"1:211178224097:web:f73bf5a81c2f4c32fc7aa0"};var t=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,s)}a((r=r.apply(e,t||[])).next())})};const n="environmentName",r="firebaseConfig",o="VGCODER";class i{static getEnvironmentName(){return t(this,void 0,void 0,function*(){return new Promise(e=>{chrome.storage.sync.get([n],t=>{const r=t[n]||o;e(r)})})})}static setEnvironmentName(e){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{e&&""!==e.trim()?chrome.storage.sync.set({[n]:e.trim()},()=>{chrome.runtime.lastError?r(chrome.runtime.lastError):t()}):r(new Error("Environment name cannot be empty"))})})}static getFirebaseConfig(){return t(this,void 0,void 0,function*(){return new Promise(t=>{chrome.storage.sync.get([r],n=>{const o=n[r];o&&Object.keys(o).length>0?t(o):t(e)})})})}static setFirebaseConfig(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{chrome.storage.sync.set({[r]:e},()=>{chrome.runtime.lastError?n(chrome.runtime.lastError):t()})})})}static resetToDefault(){return t(this,void 0,void 0,function*(){try{yield this.setEnvironmentName(o),yield new Promise(e=>{chrome.storage.sync.remove(r,()=>e())})}catch(e){throw e}})}}var c=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,s)}a((r=r.apply(e,t||[])).next())})};const s=document.getElementById("configForm"),a=document.getElementById("environmentName"),u=document.getElementById("firebaseConfig"),m=document.getElementById("resetBtn"),h=document.getElementById("message"),f=document.getElementById("currentEnv");function d(e,t){h.textContent=e,h.className=`message ${t}`,setTimeout(()=>{h.className="message"},3e3)}function g(){return c(this,void 0,void 0,function*(){try{const t=yield i.getEnvironmentName();f.textContent=t,a.value=t;const n=yield i.getFirebaseConfig();JSON.stringify(n)===JSON.stringify(e)?(u.value="",u.placeholder=`Đang sử dụng mặc định:\n${JSON.stringify(e,null,2)}`):u.value=JSON.stringify(n,null,2)}catch(e){console.error("Error loading config:",e),f.textContent="Lỗi khi tải cấu hình",d("Không thể tải cấu hình hiện tại","error")}})}s.addEventListener("submit",function(e){return c(this,void 0,void 0,function*(){e.preventDefault();const t=a.value.trim(),n=u.value.trim();if(t)try{if(yield i.setEnvironmentName(t),f.textContent=t,n)try{const e=JSON.parse(n);if(!e.apiKey||!e.databaseURL)throw new Error("Config thiếu apiKey hoặc databaseURL");yield i.setFirebaseConfig(e)}catch(e){return void d("❌ JSON Firebase Config không hợp lệ: "+e.message,"error")}else yield new Promise(e=>{chrome.storage.sync.remove("firebaseConfig",()=>e())});d("✅ Lưu cấu hình thành công!","success"),g()}catch(e){console.error("Error saving settings:",e),d("❌ Lỗi khi lưu cấu hình: "+e.message,"error")}else d("Vui lòng nhập tên môi trường","error")})}),m.addEventListener("click",function(){return c(this,void 0,void 0,function*(){if(confirm("Bạn có chắc muốn đặt lại tất cả về mặc định?"))try{yield i.resetToDefault(),yield g(),d("✅ Đã đặt lại về cấu hình mặc định!","success")}catch(e){console.error("Error resetting environment:",e),d("❌ Lỗi khi đặt lại cấu hình","error")}})}),g()})();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": 1,
|
|
4
|
+
"priority": 1,
|
|
5
|
+
"action": {
|
|
6
|
+
"type": "modifyHeaders",
|
|
7
|
+
"responseHeaders": [
|
|
8
|
+
{
|
|
9
|
+
"header": "content-security-policy",
|
|
10
|
+
"operation": "remove"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"header": "x-frame-options",
|
|
14
|
+
"operation": "remove"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"condition": {
|
|
19
|
+
"urlFilter": "*",
|
|
20
|
+
"resourceTypes": ["main_frame", "sub_frame"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
Binary file
|
package/vg-coder.zip
ADDED
|
Binary file
|
package/vg-coder-cli-2.0.8.tgz
DELETED
|
Binary file
|
package/vg-coder-cli-2.0.9.tgz
DELETED
|
Binary file
|