Skip to content

Fix Pixiv label bookmark controls visibility - #44

Open
WeilinChen1221 wants to merge 1 commit into
Ziqing19:mainfrom
WeilinChen1221:main
Open

Fix Pixiv label bookmark controls visibility#44
WeilinChen1221 wants to merge 1 commit into
Ziqing19:mainfrom
WeilinChen1221:main

Conversation

@WeilinChen1221

Copy link
Copy Markdown

Summary

This PR fixes an issue where the Pixiv Label Bookmarks controls no longer appeared after Pixiv changed its generated DOM class names and navigation layout.

Previously, the userscript depended on unstable Pixiv sc-* class selectors and attempted to inject the Label/Search controls through Pixiv's navigation area. After Pixiv's UI update, initialization could still continue, but the controls could be hidden, delayed, or blocked by missing DOM nodes.

Changes

  • Inject the Label Bookmarks control bar into document.body instead of Pixiv's nav.
  • Display the controls as a fixed floating toolbar in the upper-right corner.
  • Add explicit toolbar and button styles, including a high z-index, so Pixiv or Bootstrap styles do not hide the controls.
  • Move the primary button injection before fragile work-list enhancement logic.
  • Treat missing Pixiv work-list, edit-button, and tag-container selectors as non-fatal.
  • Add safer helpers for reading Pixiv page state from URL/API data instead of relying only on React private fields.
  • Encode bookmark tag query parameters when calling Pixiv bookmark APIs.
  • Guard against empty or invalid synonymDict / tag data during initialization.

Testing

Ran:

node --check index.js
  • Result: passed.

  • Manually verified in the browser that the userscript reaches the expected initialization flow:

    • Initialized
    • Start Injecting
    • Try Injecting
    • Element Properties Set
    • Synonym Dictionary Ready
    • Advanced Search Set

When Pixiv's work-list container is unavailable, the script may log Work container unavailable, skipped. This now only disables the optional inline work-tag display and no longer blocks the main floating Label/Search controls.

Rollback

Revert this PR to restore the previous nav-injected controls and legacy DOM selector behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant