You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/bug_report_en.yaml
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,9 @@ body:
14
14
attributes:
15
15
label: "Problem Description"
16
16
description: "What problem occurred? What is the expected normal behavior?"
17
-
placeholder: "e.g., When clicking the download button on YouTube page, the script throws a 404 error, expected to show a download window"
17
+
placeholder:
18
+
"e.g., When clicking the download button on YouTube page, the script throws a 404 error, expected to show a
19
+
download window"
18
20
validations:
19
21
required: true
20
22
@@ -37,7 +39,9 @@ body:
37
39
id: scriptcat-version
38
40
attributes:
39
41
label: ScriptCat Version
40
-
description: You can view it by clicking on the ScriptCat popup window. If possible, please use the latest version as your issue may have already been resolved
42
+
description:
43
+
You can view it by clicking on the ScriptCat popup window. If possible, please use the latest version as your
-**Content Scripts** (`src/content.ts`) - Injected into web pages to execute user scripts
16
18
-**Inject Scripts** (`src/inject.ts`) - Runs in page context with access to page globals
17
19
18
20
### Message Passing System
21
+
19
22
ScriptCat uses a sophisticated message passing architecture (`packages/message/`):
23
+
20
24
-**ExtensionMessage** - Chrome extension runtime messages between service worker/content/pages
21
25
-**WindowMessage** - PostMessage-based communication between offscreen/sandbox
22
26
-**CustomEventMessage** - CustomEvent-based communication between content/inject scripts
23
27
-**MessageQueue** - Cross-environment event broadcasting system
24
28
25
-
Key pattern: All communication flows through Service Worker → Offscreen → Sandbox for background scripts, or Service Worker → Content → Inject for page scripts.
29
+
Key pattern: All communication flows through Service Worker → Offscreen → Sandbox for background scripts, or Service
30
+
Worker → Content → Inject for page scripts.
26
31
27
32
### Script Execution Flow
33
+
28
34
1.**Page Scripts**: Service Worker registers with `chrome.userScripts` → injected into pages
29
35
2.**Background Scripts**: Service Worker → Offscreen → Sandbox execution
30
36
3.**Scheduled Scripts**: Cron-based execution in Sandbox environment
31
37
32
38
## Key Development Patterns
33
39
34
40
### Path Aliases
41
+
35
42
```typescript
36
43
"@App": "./src/"
37
44
"@Packages": "./packages/"
38
45
"@Tests": "./tests/"
39
46
```
40
47
41
48
### Repository Pattern
49
+
42
50
All data access uses DAO classes extending `Repo<T>` base class:
51
+
43
52
```typescript
44
53
// Example: ScriptDAO, ResourceDAO, SubscribeDAO
45
54
exportclassScriptDAOextendsRepo<Script> {
46
-
public save(val:Script) { returnsuper._save(val.uuid, val); }
55
+
public save(val:Script) {
56
+
returnsuper._save(val.uuid, val);
57
+
}
47
58
}
48
59
```
49
60
50
61
### Service Layer Structure
62
+
51
63
Services follow a consistent pattern with dependency injection:
- Sandbox script execution isolated from page context - use `unsafeWindow` for page access
140
162
141
163
## File Structure Patterns
164
+
142
165
- Tests co-located with source files (`.test.ts` suffix)
143
166
- Template files use `.tpl` extension for build-time processing
144
167
- Configuration files use factory pattern for environment-specific setup
145
168
146
169
## Language
170
+
147
171
- The code is developed and maintained by developers based in Mainland China.
148
172
- Comments should preferably be written in Simplified Chinese.
149
173
- The user interface supports multiple languages, with English set as the default for global users.
150
174
151
175
## PR Review Policy
152
176
153
-
When performing Pull Request (PR) reviews, Copilot must always conduct a **comprehensive and independent review** of the entire PR content.
177
+
When performing Pull Request (PR) reviews, Copilot must always conduct a **comprehensive and independent review** of the
178
+
entire PR content.
154
179
155
180
-**Full Review Every Time**
156
-
Always review **all modified files** in every PR, regardless of previous reviews or user comments. Even during re-reviews, treat the PR as new and **do not rely on prior review states**.
181
+
Always review **all modified files** in every PR, regardless of previous reviews or user comments. Even during
182
+
re-reviews, treat the PR as new and **do not rely on prior review states**.
157
183
158
184
-**No Skipping of Files**
159
-
Do not skip or ignore any text-based file types (including `.md`, `.json`, `.yml`, `.toml`, `.ts`, `.js`, `.py`, `.html`, `.css`, `.tsx`, `.vue`, `.sh`, etc.). Every file that is changed must be fully examined.
185
+
Do not skip or ignore any text-based file types (including `.md`, `.json`, `.yml`, `.toml`, `.ts`, `.js`, `.py`,
186
+
`.html`, `.css`, `.tsx`, `.vue`, `.sh`, etc.). Every file that is changed must be fully examined.
160
187
161
188
-**Reference as Context Only**
162
-
PR descriptions, commit messages, or user discussions serve only as **reference context**. The review must focus primarily on the **actual code and file changes**.
189
+
PR descriptions, commit messages, or user discussions serve only as **reference context**. The review must focus
190
+
primarily on the **actual code and file changes**.
163
191
164
192
-**Infer Intent from Code Changes**
165
-
Always attempt to **infer the purpose and intent** of the changes directly from the modified content, rather than relying solely on user statements or PR titles.
193
+
Always attempt to **infer the purpose and intent** of the changes directly from the modified content, rather than
194
+
relying solely on user statements or PR titles.
166
195
167
196
-**Critical Thinking Requirement**
168
-
For each change, Copilot should assess correctness, consistency, and maintainability — ensuring that logic, style, and architectural impact align with project standards.
197
+
For each change, Copilot should assess correctness, consistency, and maintainability — ensuring that logic, style, and
198
+
architectural impact align with project standards.
169
199
170
200
-**Independent Verification**
171
-
Do not assume unchanged files or previously reviewed sections are safe; verify all code paths potentially affected by the modifications.
201
+
Do not assume unchanged files or previously reviewed sections are safe; verify all code paths potentially affected by
0 commit comments