修复图文发布:创作中心导航、图文标签切换及表单选择器

- 发布前先访问主站建立 session,再跳转创作中心(直接导航会 401)
- 切换「上传图文」标签:跳过 style.left=-9999px 的隐藏副本,不用 getBoundingClientRect
- 修复上传缩略图选择器:.upload-item img → .img-upload-area .img-container
- 修复标题输入框:#note-title → input.d-text[placeholder*="标题"]
- 修复内容编辑器:#note-content → .tiptap.ProseMirror
- 修复发布按钮:.publishBtn → button.d-button:has-text("发布")
- 新增 debug-publish.ts 调试脚本
This commit is contained in:
2026-03-02 01:08:03 +08:00
parent 9d0a9c93f4
commit 7661a723ea
3 changed files with 142 additions and 13 deletions
+7 -7
View File
@@ -134,17 +134,17 @@ export const XHS_SELECTORS = {
/** The file input element for uploading images on the creator publish page. */
imageFileInput: 'input[type="file"]',
/** Title input field on the publish form. */
titleInput: '#note-title',
/** Content / body editor area on the publish form (contenteditable). */
contentEditor: '#note-content',
titleInput: 'input.d-text[placeholder*="标题"]',
/** Content / body editor area on the publish form (contenteditable ProseMirror). */
contentEditor: '.tiptap.ProseMirror',
/** The tag / topic button that opens the topic input. */
tagButton: '#topicBtn',
tagButton: 'button.contentBtn.topic-btn',
/** Tag / topic input field for typing hashtags. */
tagInput: '#topicBtn input',
tagInput: 'button.contentBtn.topic-btn input',
/** Topic / hashtag suggestion dropdown item. */
tagSuggestionItem: '.publish-topic-item, .topic-item',
/** "Publish" / submit button. */
publishButton: '.publishBtn',
publishButton: 'button.d-button:has-text("发布")',
/** Schedule / timing selector button. */
scheduleButton: '.timing-btn, button:has-text("定时")',
/** Schedule date/time input field. */
@@ -160,7 +160,7 @@ export const XHS_SELECTORS = {
/** Visibility option for friends only. */
visibilityFriends: '.permission-option:has-text("好友"), .visibility-option:has-text("好友")',
/** Upload complete indicator (images uploaded and thumbnails visible). */
uploadedImageItem: '.upload-item img, .img-item img, .image-item img',
uploadedImageItem: '.img-upload-area .img-container',
/** Video upload complete indicator (video thumbnail visible). */
uploadedVideoItem: '.upload-video video, .video-item video, .video-container video',
/** Success indicator shown after publish completes. */