Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
c80e91e
chore: add GitHub workflow for automated extension release
cunoe Feb 7, 2025
65c673f
chore: update extension release workflow file paths
cunoe Feb 7, 2025
a567be6
fix: simplify feedback email localization text
cunoe Feb 8, 2025
ab388df
refactor: remove collection-related services and components
cunoe Feb 8, 2025
df8c748
refactor: improve Xiaohongshu note upload process with more robust el…
cunoe Feb 8, 2025
a17163f
fix: update GitHub issues link to main repository
cunoe Feb 8, 2025
d646820
feat: add support for Okjike platform dynamic sync (#29)
cunoe Feb 8, 2025
c82c133
feat: add trusted domains settings with domain validation and storage…
cunoe Feb 8, 2025
74293b9
docs: update README files with comprehensive development and usage in…
cunoe Feb 8, 2025
c2e3a96
chore: update dependencies and remove unused packages
cunoe Feb 8, 2025
a38126c
refactor: replace onClick with onPress in Button components
cunoe Feb 8, 2025
f618505
feat: add homepage publish button to header with localization
harryisfish Feb 8, 2025
22eebe2
26 feat support csdn (#41)
cunoe Feb 9, 2025
91e0cec
feat: support zhihu zhuanlan (#43)
cunoe Feb 9, 2025
193798c
docs: update README with enhanced project badges and store links
harryisfish Feb 9, 2025
58e920c
docs: refactor README structure and improve localization
harryisfish Feb 9, 2025
2ffbb1d
feat: add Juejin platform support for article sync (#46)
cunoe Feb 9, 2025
968f38e
feat: add Jianshu platform support for article sync
cunoe Feb 9, 2025
ffe748a
feat: support csdn article scraper (#47)
cunoe Feb 9, 2025
ed74580
feat: add Zhihu zhuanlan article scraper support (#48)
cunoe Feb 9, 2025
6010ed9
feat: add WeChat article scraper support (#49)
cunoe Feb 9, 2025
69e0ab2
feat: add juejin article scraper support
cunoe Feb 9, 2025
c63e980
feat: add Jianshu article scraper support
cunoe Feb 9, 2025
b17cc76
chore: bump version to 0.0.5
cunoe Feb 9, 2025
d51d1f4
chore: upgrade GitHub Actions artifact actions to v4
cunoe Feb 9, 2025
0855a68
chore: update extension upload file paths in release workflow
cunoe Feb 9, 2025
f7c99c3
docs: add multilingual README files for French, Japanese, and Korean …
harryisfish Feb 10, 2025
59d55fe
docs: minor formatting update in French and Korean README files
harryisfish Feb 10, 2025
2db844f
docs: add Star History chart to README
harryisfish Feb 10, 2025
0420439
feat: add Segmentfault article sync support with Markdown conversion
cunoe Feb 13, 2025
55d7c66
feat: add floating sync status UI for CSDN and Segmentfault article sync
cunoe Feb 13, 2025
db8fb9d
refactor: remove debug console logs in extension message handler
cunoe Feb 13, 2025
a3dc170
chore: update on-install landing page URL
harryisfish Feb 23, 2025
b60947f
chore: simplify options page title in localization files
harryisfish Feb 24, 2025
1de8de1
chore: update project ignore files and VS Code settings
harryisfish Feb 24, 2025
9d791f0
chore: bump version to 0.0.6
harryisfish Feb 24, 2025
a2c149f
chore: upgrade Plasmo framework and related dependencies to latest ve…
cunoe Feb 25, 2025
f323da6
refactor: improve Facebook dynamic sync with more robust element sele…
cunoe Feb 25, 2025
d36b88e
feat: reddit自动上传 (#56)
Marcistm Feb 25, 2025
6115a90
feat: support weixin video (#64)
Marcistm Feb 25, 2025
9d3f1f5
62 feat kuaishou platform (#65)
cunoe Feb 25, 2025
1c3162a
feat: enhance DynamicTab with paste and drag-and-drop file support (#66)
cunoe Feb 25, 2025
bfc88b3
70 feat support baijiahao (#71)
cunoe Feb 26, 2025
8013f1a
72 feat support toutiao (#73)
cunoe Feb 26, 2025
0a6164d
feat: add Weibo video platform sync support (#75)
cunoe Feb 27, 2025
3115245
74 feat weibo video (#77)
cunoe Feb 27, 2025
28a2310
feat: save platforms selected #32 (#68)
Marcistm Feb 28, 2025
0690c26
chore: add QQ group link in options footer
cunoe Feb 28, 2025
f8ade5a
docs: add contact information to README files across languages
cunoe Feb 28, 2025
665c841
docs: update QQ group link in README files across languages
cunoe Feb 28, 2025
be76d42
fix: remove redundant code (#79)
Marcistm Feb 28, 2025
796dc45
feat: added the function of clearing platform selection
cunoe Feb 28, 2025
8bf182f
chore: bump extension version to 0.0.7
cunoe Feb 28, 2025
1618679
docs: enhance README files with platform badges and star history
harryisfish Mar 2, 2025
c1ca47c
feat: support dynamic threads (#84)
Marcistm Mar 3, 2025
898d64f
fix: disable automatic tag selection in Kuaishou video upload
cunoe Mar 3, 2025
509e988
fix: improve Douyin video upload file input selector and add upload b…
cunoe Mar 3, 2025
c48d472
69 refactor dynamic only supports images and text posting (#85)
cunoe Mar 3, 2025
e1b871e
refactor: modularize platform info maps for dynamic, article, and video
cunoe Mar 3, 2025
3b00b93
81 feat dynamic post weixin (#86)
cunoe Mar 3, 2025
3af1202
40 feat support bluesky (#87)
cunoe Mar 3, 2025
11170d1
docs: update Star History chart URL to leaper-one repository
cunoe Mar 3, 2025
bd00109
docs: update recommended articles section
harryisfish Mar 4, 2025
8206265
feat: add V2EX platform localization support
cunoe Mar 4, 2025
d1b6ab7
88 feat extension postmessages origin management (#89)
cunoe Mar 4, 2025
6bb7367
chore: bump extension version to 0.0.8
cunoe Mar 4, 2025
9edab60
feat: add trust domain confirmation message handling
cunoe Mar 5, 2025
ad3110a
docs: add development and extension usage documentation
cunoe Mar 5, 2025
c9d1271
chore: bump extension version to 0.0.9
cunoe Mar 5, 2025
5fa2abb
docs: add external request and service status check utilities
cunoe Mar 5, 2025
3518135
docs: add development guidelines for Chrome Extension
harryisfish Mar 11, 2025
8eb9443
docs: update external interface usage documentation
harryisfish Mar 11, 2025
d9083ce
refactor: optimize sync tabs with improved state management and perfo…
harryisfish Mar 11, 2025
52df88a
chore: remove unnecessary VSCode extensions
harryisfish Mar 12, 2025
4c82b97
feat: enhance popup loading experience with loading screen
harryisfish Mar 12, 2025
e1c4ead
feat(localization): add popup loading screen translations
harryisfish Mar 12, 2025
395a48b
feat(localization): add error messages and improve processing status …
harryisfish Mar 12, 2025
d2a0ad1
docs: add development guidelines and rules for Chrome Extension
harryisfish Mar 12, 2025
8b8d8b4
docs(i18n): update internationalization guidelines for message keys
harryisfish Mar 12, 2025
32abdab
feat(ui): enhance contact and support section in options page
harryisfish Mar 12, 2025
c79e24d
refactor(ui): optimize tailwind class order and spacing in sync and t…
harryisfish Mar 12, 2025
8e016ff
refactor(ui): replace anchor links with Heroui Button components in H…
harryisfish Mar 12, 2025
4be3cd2
Update README-zh.md (#90)
Qcaid Mar 12, 2025
11b290e
chore: remove outdated development guidelines
harryisfish Mar 13, 2025
db1a8e7
91 feat support douban (#92)
cunoe Mar 13, 2025
96a508d
feat(video): add Zhihu platform support
cunoe Mar 13, 2025
e36a0b8
feat(platform): add Dedao platform support
cunoe Mar 13, 2025
ac74298
chore(package): update version to 1.0.0
cunoe Mar 13, 2025
c8b1e4f
93 feat support weixin (#94)
cunoe Mar 15, 2025
0c2b3e5
docs: update README files for better structure and clarity
harryisfish Mar 16, 2025
57da452
chore(package): update version to 1.0.1
cunoe Mar 17, 2025
4aef7ed
docs: update README files to include repository links
harryisfish Mar 18, 2025
8eb4d43
fix: jike dynamic #99 (#100)
Marcistm Mar 19, 2025
d42c6df
Doc update for dev (#102)
harryisfish Mar 21, 2025
f71c624
docs: update README
harryisfish Mar 26, 2025
4d81b05
docs: update star history section in multiple language README files
harryisfish Mar 26, 2025
f5af423
docs: simplify center alignment in README files
harryisfish Mar 26, 2025
2f04450
feat(platform): add accordion for platform selection in ArticleTab, D…
cunoe Mar 29, 2025
2cdf992
feat(account): integrate account information retrieval for platforms
cunoe Mar 29, 2025
cbc758a
chore(package): update version to 1.0.2
cunoe Mar 29, 2025
e2c4945
docs: update links in README files for Web Trace
cunoe Mar 30, 2025
8b211c9
feat(account): enhance account information retrieval and error handling
cunoe Mar 31, 2025
9f0f068
feat(locales): add new platform titles for CN and EN in messages.json
cunoe Mar 31, 2025
39db006
chore(package): update version to 1.0.3
cunoe Mar 31, 2025
975119d
fix(account): update login check in getBilibiliAccountInfo function
cunoe Apr 1, 2025
8b9d08e
feat(locales): add dashboard option title in messages.json for CN and EN
harryisfish Apr 1, 2025
bc3d50e
feat(sync): update platform selection and localization in ArticleTab,…
harryisfish Apr 1, 2025
20c5c8b
refactor(sync): update platform tags from 'EN' to 'International' (#111)
cunoe Apr 2, 2025
eaf609c
105 feat udpate dev doc (#107)
harryisfish Apr 2, 2025
25b2942
61 feat support for platform specific addition of extra information w…
cunoe Apr 3, 2025
b6a6050
feat(sync): add support for ZhiShiXingQiu platform
cunoe Apr 3, 2025
b61b9d6
feat(sync): implement DynamicZSXQ modal for group selection and confi…
cunoe Apr 3, 2025
7d2dd88
refactor(sync): improve layout of PlatformCheckbox component
cunoe Apr 3, 2025
fb7c893
fix(sync): ensure customInjectUrls is validated before creating tabs
cunoe Apr 3, 2025
0eea23e
fix(sync): adjust post content formatting in DynamicZSXQ
cunoe Apr 3, 2025
7aa38ec
feat(sync): add WordPress platform support and configuration modal
cunoe Apr 3, 2025
718a421
refactor(sync): update tab creation logic in createTabsForPlatforms
cunoe Apr 3, 2025
796ccc6
chore(package): bump version to 1.0.4
cunoe Apr 3, 2025
ab88829
fix(docs): update star history chart links in README
harryisfish Apr 3, 2025
15e3db3
chore: update issue templates
harryisfish Apr 6, 2025
11ca4e3
Update issue templates
harryisfish Apr 6, 2025
0b51ce3
feat: web app modal (#117)
harryisfish Apr 6, 2025
7bd38ff
feat: publish api (#118)
cunoe Apr 7, 2025
53f336a
chore(package): bump version to 1.0.5
cunoe Apr 7, 2025
aada9cc
chore(package): bump version to 1.1.0
cunoe Apr 7, 2025
ec26797
docs: update README and remove outdated development documents
cunoe Apr 8, 2025
5c188a2
feat: add automation view button and localization (#119)
harryisfish Apr 11, 2025
74724ca
feat: add article editor alert and localization (#121)
harryisfish Apr 11, 2025
184d3de
chore(package): bump version to 1.1.1
cunoe Apr 12, 2025
aea6c4b
docs: update README files in multiple languages (#122)
harryisfish Apr 20, 2025
70192e9
feat: enhance trust domain management and improve code structure (#124)
harryisfish Apr 20, 2025
047ecf1
chore(package): bump version to 1.1.2
cunoe Apr 20, 2025
463708e
feat(podcast): add support for QQMusic and LiZhi platforms (#128)
cunoe Apr 21, 2025
7c4688a
129 feat account refresh tab (#130)
cunoe Apr 21, 2025
dbe497d
131 refactor article (#133)
cunoe Apr 22, 2025
44da47f
refactor(refresh-accounts): update useEffect dependency for clarity
cunoe Apr 22, 2025
7afb85c
refactor(options): simplify Options component and update navigation l…
harryisfish Apr 22, 2025
519ebca
feat(video): add tags support for video data and enhance input handli…
cunoe Apr 23, 2025
0f0a2b7
refactor(tabs): comment out script injection and tab activation logic
cunoe Apr 23, 2025
a99389d
refactor(tabs): streamline tab creation and grouping logic
cunoe Apr 23, 2025
af62bef
Update CONTRIBUTING.md (#136)
harryisfish Apr 23, 2025
9cd3b15
fix(tabs): update tab creation URL to use injectUrl
cunoe Apr 24, 2025
875eb23
chore(package): bump version to 1.1.4
cunoe Apr 24, 2025
263b0d0
refactor(helper): remove Weibo video upload functionality and update …
cunoe Apr 28, 2025
27f117c
97 feat bilibili article (#141)
cunoe Apr 28, 2025
7d20da1
feat(sspai): add SSPai article synchronization functionality (#142)
cunoe Apr 28, 2025
8e5f104
fix(popup): update focused option to use request.data.isFocused
cunoe Apr 28, 2025
579b6cf
feat(51cto): add article synchronization functionality for 51CTO (#144)
cunoe Apr 28, 2025
44adf0c
feat(xueqiu): add article synchronization functionality for Xueqiu (#…
cunoe Apr 28, 2025
e298a76
feat(weibo): add article synchronization functionality for Weibo (#148)
cunoe Apr 28, 2025
83f653b
114 feat support eastmoney (#150)
cunoe Apr 28, 2025
dfc3885
chore(package): bump version to 1.1.5
cunoe Apr 28, 2025
8840e9d
refactor(debug): update debug log messages for consistency
cunoe Apr 28, 2025
260c93f
refactor(dynamic): streamline media upload and publishing process
cunoe Apr 29, 2025
4aa6694
refactor(dynamic): improve debug logging and streamline image upload …
cunoe Apr 29, 2025
4186033
refactor(publish): enhance image and video processing with improved e…
cunoe Apr 29, 2025
b0f7aca
chore(package): bump version to 1.1.6
cunoe Apr 29, 2025
99a4eea
Update README.md (#151)
harryisfish May 8, 2025
b2aab66
Update README.md (#152)
harryisfish May 13, 2025
7777d15
Update README.md (#153)
harryisfish May 13, 2025
4a657cb
Update README.md (#154)
harryisfish May 14, 2025
b19afb9
chore(icon): update icon image and add entry point instructions (#157)
harryisfish May 19, 2025
7234875
Update README.md (#158)
harryisfish May 19, 2025
7ac0998
feat: update version to 1.2.0 (#159)
harryisfish May 19, 2025
4f451a6
fix: update logo subfix (#160)
harryisfish May 19, 2025
ceb20fc
chore: remove CONTRIBUTING.md and update icon image (#162)
harryisfish May 19, 2025
32f523d
Update README.md (#163)
harryisfish May 23, 2025
8ccc021
Feat auto close publish page (#164)
harryisfish May 25, 2025
eafecd1
chore(package): bump version to 1.2.3 (#165)
harryisfish May 25, 2025
0e9f622
169 feat auto close tabs after publish (#172)
cunoe May 30, 2025
eb5717f
feat(weixinchannel): enhance video publishing functionality with shad…
cunoe May 30, 2025
b858e9a
chore(package): bump version to 1.2.4
cunoe May 30, 2025
16c170d
chore(pnpm): add additional built dependencies for improved project m…
cunoe Jun 1, 2025
8e2a412
feat(weixinchannel): enhance wechat video channel dynamic publishing …
qftie Jun 6, 2025
a5f821d
chore(package): bump version to 1.2.5
cunoe Jun 6, 2025
09e6a84
docs(README): add DartNode branding image to README
cunoe Jun 8, 2025
8db297d
fix: bluesky media upload (#180)
cunoe Jun 24, 2025
e4cb000
chore(package): bump version to 1.2.6
cunoe Jun 24, 2025
c67bdc4
fix(zhihu): update placeholder text for title input field (#183)
cunoe Jul 2, 2025
f28cf72
182 feat xiaoheihe (#184)
cunoe Jul 2, 2025
36defc7
feat(weibo): add upload completion check for images
cunoe Jul 2, 2025
48e894f
chore(package): bump version to 1.2.7
cunoe Jul 2, 2025
246d0ad
feat(douyin): enhance image upload and publishing process
cunoe Jul 4, 2025
4ad4cbc
chore(workflow): remove close inactive issues workflow
cunoe Jul 5, 2025
d8b6f3b
185 feat support video cover upload (#186)
cunoe Jul 5, 2025
b099cbd
feat(toutiaohao): add support for Toutiaohao platform (#188)
cunoe Jul 5, 2025
40d1f86
chore(package): bump version to 1.2.8
cunoe Jul 5, 2025
f11aed8
docs(README): add sponsorship section and update branding images
cunoe Jul 8, 2025
bc64c67
feat(douban): enhance dynamic posting process
cunoe Jul 10, 2025
8ccadd2
refactor(okjike): improve topic selection handling
cunoe Jul 13, 2025
82a90a6
chore(package): bump version to 1.2.9
cunoe Jul 13, 2025
9b15009
fix: correct spelling errors in action types
cunoe Jul 29, 2025
1f5c349
chore(package): bump version to 1.2.10
cunoe Jul 29, 2025
60f2511
fix: improve action type handling
cunoe Jul 29, 2025
7c6f5d9
chore(package): bump version to 1.2.11
cunoe Jul 29, 2025
d8cb279
fix: update inject URLs for Rednote platform
cunoe Oct 16, 2025
d833481
chore(package): bump version to 1.2.12
cunoe Oct 16, 2025
6d0c1f5
fix(rednote): enhance content insertion method
cunoe Oct 16, 2025
b3054bb
chore(package): bump version to 1.2.13
cunoe Oct 16, 2025
0153cb0
fix: enhance request type validation in message listener
cunoe Nov 1, 2025
8878663
chore(package): bump version to 1.2.14
cunoe Nov 1, 2025
8c2eb44
feat(kuaishou): enhance dynamic content publishing with image validat…
cunoe Nov 17, 2025
09d30da
chore(package): bump version to 1.2.15
cunoe Nov 17, 2025
57155c1
feat(video): add scheduled publishing feature and enhance video data …
cunoe Nov 17, 2025
7fb320f
chore(package): bump version to 1.3.0
cunoe Nov 17, 2025
e60fb41
feat(qie): add support for QiEHao platform
Nov 23, 2025
a1db867
feat(i18n): add internationalization support for QiE platform
Nov 23, 2025
1b91502
feat: enhance dynamic WeChat channel synchronization logic
cunoe Nov 25, 2025
fad2715
chore: bump package version to 1.3.1
cunoe Nov 25, 2025
ebdea56
feat(chejiahao): add support for Chejiahao Platform
Nov 25, 2025
2fbc3d8
Merge remote-tracking branch 'upstream/main'
Nov 25, 2025
7aff5b3
feat: add dewu platform to video platform registry
Nov 25, 2025
ed47276
feat: restore and merge stash with multiple new platforms
Nov 25, 2025
5618936
feat(dewu): optimize cover upload with intelligent aspect ratio selec…
Nov 25, 2025
cb7ebf2
feat(zhihu): improve dynamic content publishing with enhanced image u…
cunoe Nov 26, 2025
5f54f79
chore: bump package version to 1.3.2
cunoe Nov 26, 2025
8f00f9e
docs: add CLAUDE.md for project guidance and development instructions
cunoe Nov 26, 2025
974885e
fix(dewu): fix cropper initialization timing and modal close sequence
Nov 26, 2025
eb59f69
feat(dayu): complete video publishing integration
Nov 27, 2025
ae5e392
feat: integrate dayu video publishing feature
Nov 27, 2025
199938c
feat(douyin): optimize content and tags format - place description be…
Nov 28, 2025
1c26472
docs: update CLAUDE.md with simplified project guidance
harryisfish Nov 28, 2025
6aae612
feat: merge PR #196 - add video support for 11 platforms
harryisfish Nov 28, 2025
f3f46a7
chore: fix security vulnerabilities via dependency overrides
harryisfish Nov 28, 2025
2580d16
chore: bump version to 1.3.4 (#197)
harryisfish Nov 28, 2025
cc3a279
docs: remove sponsorship section from README.md
cunoe Nov 30, 2025
2679157
feat: add Substack platform support for dynamic and article publishing
cunoe Dec 5, 2025
1eb9a57
refactor: remove unused file parameter from injectFunction type
cunoe Dec 5, 2025
2370709
Refactor/migrate to biome (#199)
cunoe Dec 5, 2025
1dd8a04
fix: improve Instagram dynamic publishing reliability
cunoe Dec 5, 2025
2843287
fix: improve Facebook dynamic publishing reliability
cunoe Dec 5, 2025
6fecf6f
fix: improve LinkedIn dynamic publishing reliability
cunoe Dec 5, 2025
1703da2
fix: improve Reddit dynamic publishing reliability
cunoe Dec 5, 2025
fa3596e
fix: update Reddit injectUrl to IMAGE type
cunoe Dec 5, 2025
ab94fd9
feat: add Maimai and Juejin dynamic platform support
cunoe Dec 5, 2025
6975b57
fix: resolve TypeScript Element type errors in video sync modules
cunoe Dec 5, 2025
bf4aa8a
chore: bump version to 1.3.5
cunoe Dec 5, 2025
09f9a7f
fix: resolve TypeScript errors and update options redirect
cunoe Dec 6, 2025
6f9c884
chore: bump version to 1.3.6
cunoe Dec 6, 2025
eda5ed3
docs: update README with developer documentation link (#202)
harryisfish Jan 14, 2026
f9a4045
doc: update contact information in README (#203)
harryisfish Jan 14, 2026
0720ed3
fix: improve Kuaishou publishing and use production URL
cunoe Jan 19, 2026
f5474a0
chore: bump version to 1.3.7
cunoe Jan 19, 2026
e39c2f2
fix: resolve dependabot security alerts via pnpm overrides (#208)
harryisfish Mar 1, 2026
f129b00
chore: update caniuse-lite database
Mar 1, 2026
4a7f9e2
chore: bump version to 1.3.8
Mar 3, 2026
3075416
fix: 防止重复发布与等待头条图片上传完成
May 3, 2026
44493dd
fix(toutiao): fallback to background fetch for mixed content image
xiaopanddxiong May 3, 2026
b76d024
feat(xiaohongshu): 支持小红书发布
xiaopanddxiong May 4, 2026
beb348c
fix(xiaohongshu): 小红书等待上传
xiaopanddxiong May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .cursor/rules/ai.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
description: AI, deepseek, openai, claude, llm
globs:
alwaysApply: false
---
AI SDK
- Use the Vercel AI SDK UI for implementing streaming chat UI.
- Use the Vercel AI SDK Core to interact with language models.
- Use the Vercel AI SDK RSC and Stream Helpers to stream and help with the generations.
- Implement proper error handling for AI responses and model switching.
- Implement fallback mechanisms for when an AI model is unavailable.
- Handle rate limiting and quota exceeded scenarios gracefully.
- Provide clear error messages to users when AI interactions fail.
- Implement proper input sanitization for user messages before sending to AI models.
- Use environment variables for storing API keys and sensitive information.
171 changes: 171 additions & 0 deletions .cursor/rules/chrome-extension.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
description:
globs:
alwaysApply: true
---
You are an expert Chrome extension developer, proficient in JavaScript/TypeScript, browser extension APIs, and web development.

Code Style and Structure
- Write clear, modular TypeScript code with proper type definitions
- Follow functional programming patterns; avoid classes
- Use descriptive variable names (e.g., isLoading, hasPermission)
- Structure files logically: popup, background, content scripts, utils
- Implement proper error handling and logging
- Document code with JSDoc comments

Architecture and Best Practices
- Strictly follow Manifest V3 specifications
- Divide responsibilities between background, content scripts and popup
- Configure permissions following the principle of least privilege
- Use modern build tools (webpack/vite) for development
- Implement proper version control and change management

Chrome API Usage
- Use chrome.* APIs correctly (storage, tabs, runtime, etc.)
- Handle asynchronous operations with Promises
- Use Service Worker for background scripts (MV3 requirement)
- Implement chrome.alarms for scheduled tasks
- Use chrome.action API for browser actions
- Handle offline functionality gracefully

Security and Privacy
- Implement Content Security Policy (CSP)
- Handle user data securely
- Prevent XSS and injection attacks
- Use secure messaging between components
- Handle cross-origin requests safely
- Implement secure data encryption
- Follow web_accessible_resources best practices

Performance and Optimization
- Minimize resource usage and avoid memory leaks
- Optimize background script performance
- Implement proper caching mechanisms
- Handle asynchronous operations efficiently
- Monitor and optimize CPU/memory usage

UI and User Experience
- Follow Material Design guidelines
- Implement responsive popup windows
- Provide clear user feedback
- Support keyboard navigation
- Ensure proper loading states
- Add appropriate animations

Internationalization
- Use chrome.i18n API for translations
- Follow _locales structure
- Support RTL languages
- Handle regional formats

Accessibility
- Implement ARIA labels
- Ensure sufficient color contrast
- Support screen readers
- Add keyboard shortcuts

Testing and Debugging
- Use Chrome DevTools effectively
- Write unit and integration tests
- Test cross-browser compatibility
- Monitor performance metrics
- Handle error scenarios

Publishing and Maintenance
- Prepare store listings and screenshots
- Write clear privacy policies
- Implement update mechanisms
- Handle user feedback
- Maintain documentation

Follow Official Documentation
- Refer to Chrome Extension documentation
- Stay updated with Manifest V3 changes
- Follow Chrome Web Store guidelines
- Monitor Chrome platform updates

Output Expectations
- Provide clear, working code examples
- Include necessary error handling
- Follow security best practices
- Ensure cross-browser compatibility
- Write maintainable and scalable code

File Structure:
```
src/
├── popup/ # Popup window related code
├── background/ # Background service code
├── contents/ # Content scripts
├── components/ # Shared components
│ ├── ui/ # UI components
│ └── features/ # Feature components
├── utils/ # Utility functions
├── types/ # Type definitions
└── static/ # Static assets
```

Chrome API Usage:
- Properly use chrome.* APIs (storage, tabs, runtime, etc.)
- Handle asynchronous operations with Promises
- Use Service Worker for background scripts (MV3 requirement)
```typescript
// Storage API example
const storage = {
get: async <T>(key: string): Promise<T | undefined> => {
const result = await chrome.storage.local.get(key);
return result[key];
},
set: async <T>(key: string, value: T): Promise<void> => {
await chrome.storage.local.set({ [key]: value });
}
};

// Tabs API example
const tabs = {
getCurrentTab: async () => {
const [tab] = await chrome.tabs.query({
active: true,
currentWindow: true
});
return tab;
}
};
```

Security and Privacy:
- Implement Content Security Policy (CSP)
- Handle user data securely
- Prevent XSS and injection attacks
- Secure component communication
- Handle cross-origin requests safely
```typescript
// Secure message passing
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (!sender.id || sender.id !== chrome.runtime.id) {
return;
}
// Process message
});
```

Performance Optimization:
- Minimize useEffect and setState usage
- Use dynamic loading for non-critical components
- Implement appropriate caching strategies
```typescript
// Caching strategy example
const CACHE_DURATION = 1000 * 60 * 5; // 5 minutes

async function fetchWithCache<T>(key: string, fetcher: () => Promise<T>): Promise<T> {
const cached = await storage.get<{ data: T; timestamp: number }>(key);

if (cached && Date.now() - cached.timestamp < CACHE_DURATION) {
return cached.data;
}

const data = await fetcher();
await storage.set(key, { data, timestamp: Date.now() });
return data;
}
```
133 changes: 133 additions & 0 deletions .cursor/rules/comment.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
description: writing or editing code
globs: *.tsx, *.js, *.ts
alwaysApply: false
---
# Code Commenting Guidelines

## 基本原则 Basic Principles
- 注释应该解释**为什么**这样做,而不是**做了什么**
- 代码即文档,仅在必要时添加注释
- 使用清晰简洁的语言,避免冗余, English
- 及时更新注释,确保与代码同步

## 文件头注释 File Header Comments
```typescript
/**
* @file 文件的简要描述
* @description 详细描述文件的功能和用途
* @author [作者名称]
* @date YYYY-MM-DD
*/
```

## 函数注释 Function Comments
```typescript
/**
* 函数的简要描述
* @description 详细描述函数的功能
* @param {string} param1 - 参数1的描述
* @param {number} param2 - 参数2的描述
* @returns {Promise<boolean>} 返回值的描述
* @throws {Error} 可能抛出的错误
* @example
* const result = await someFunction('test', 123);
*/
function someFunction(param1: string, param2: number): Promise<boolean> {
// ...
}
```

## 行内注释 Inline Comments
```typescript
// ✅ 好的注释:解释复杂的业务逻辑
if (user.role === 'admin' && !isHoliday) {
// 管理员在非假日期间具有特殊权限
grantSpecialAccess();
}

// ❌ 不好的注释:陈述显而易见的事实
// 检查用户是否为管理员
if (user.role === 'admin') {
// ...
}
```

## 待办注释 TODO Comments
```typescript
// TODO(github-username): 实现用户认证功能 (#123)
// FIXME(github-username): 修复内存泄漏问题 (#456)
// NOTE: 这里使用递归可能会导致性能问题
```

## 类型定义注释 Type Definition Comments
```typescript
/**
* 用户配置接口
* @interface UserConfig
* @property {string} name - 用户名
* @property {number} age - 年龄
* @property {string[]} permissions - 权限列表
*/
interface UserConfig {
name: string;
age: number;
permissions: string[];
}
```

## 常量和枚举注释 Constants and Enum Comments
```typescript
/**
* 用户角色枚举
* @enum {string}
*/
enum UserRole {
/** 管理员用户 */
ADMIN = 'admin',
/** 普通用户 */
USER = 'user',
/** 访客用户 */
GUEST = 'guest',
}

/** 最大重试次数 */
const MAX_RETRY_COUNT = 3;
```

## 弃用注释 Deprecation Comments
```typescript
/**
* @deprecated 从 v2.0.0 开始弃用,请使用 `newFunction()` 替代
* @see {@link newFunction}
*/
function oldFunction() {
// ...
}
```

## 区块注释 Section Comments
```typescript
//===================================
// 初始化配置
//===================================

//===================================
// 工具函数
//===================================

//===================================
// 事件处理
//===================================
```

## 注释规范检查 Comment Linting
- 使用 ESLint 的 `eslint-plugin-jsdoc` 插件检查注释格式
- 在 CI/CD 流程中包含注释检查
- 定期审查和更新过时的注释

## 最佳实践 Best Practices
- 使用 JSDoc 风格的注释以获得更好的 IDE 支持
- 为公共 API 和复杂的业务逻辑编写详细注释
- 避免注释掉的代码,使用版本控制系统代替
- 定期清理无用和过时的注释
49 changes: 49 additions & 0 deletions .cursor/rules/i18n.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
description: i18n, 国际化, 翻译, tanslation, chinese, english
globs: locales/**/*.json
alwaysApply: false
---
Internationalization (i18n) Guidelines:

Message Structure:
- Store all text content in `/locales/[locale]/messages.json`
- Use descriptive message keys in camelCase: `errorImportingContent`
- Include placeholders with $PLACEHOLDER$ syntax
- Add descriptions for translators in message files
- `console.log` don't need add i18n, only for UI text display on screen

Message Format:
```json
"extensionDisplayName": {
"message": "MultiPost",
"description": "Multipost Extension"
},
```

Implementation:
- Use `chrome.i18n.getMessage('extensionDisplayName')` for all user-facing text
- Never hardcode text strings in UI components
- Handle RTL languages with appropriate CSS
- Set default_locale in manifest.json
- Support fallback locales

Best Practices:
- Keep messages concise and clear
- Use semantic keys (e.g., WELCOME_MESSAGE vs MSG_001)
- Maintain consistent terminology across translations
- Handle pluralization properly
- Consider cultural differences in formatting dates, numbers, and currencies
- Test UI with different language lengths

Code Examples:
```typescript
// Component usage
const message = chrome.i18n.getMessage("WELCOME_MESSAGE", [username]);

// Manifest configuration
{
"default_locale": "en",
"name": "__MSG_extension_name__",
"description": "__MSG_extension_description__"
}
```
Loading