Text Highlighter and Saver

Highlight selected text and save highlights to local storage

作者
Zab Kas
日安装量
0
总安装量
32
评分
0 0 0
版本
1.0
创建于
2023-12-06
更新于
2023-12-06
大小
2.7 KB
许可证
MIT
适用于
所有网站

Title: Text Highlighter and Saver

Short Description: Automatically highlights selected text on a webpage and saves these highlights for future reference.

Detailed Description:
The Text Highlighter and Saver UserScript is designed to enhance your web reading experience by allowing you to highlight and save important text directly on web pages. It's particularly useful for research, studying, or when revisiting websites and wanting to quickly find previously noted information.

Key Features:

Text Highlighting: Simply select the text you wish to highlight, and it automatically gets a yellow background.
Persistent Highlights: Highlights are saved to your browser's local storage, ensuring that they persist across page reloads and browser restarts.
Automatic Reload: Previously highlighted texts are automatically reloaded and highlighted when you revisit a page.
How It Works:

The script listens for a text selection event (mouseup).
Once text is selected, it wraps the selected text in a span element with a yellow background.
The script saves the start and end points of the selection in the local storage, keyed by the page's URL.
Upon revisiting the page, the script checks for saved highlights and re-applies them to the text.