๐ ็ฎไฝไธญๆ | English
Smart Linkify โ Instant hyperlink conversion is an efficient Chrome browser extension that automatically scans and converts plain text URLs (like http://example.com or www.google.com) into clickable HTML hyperlinks (<a> tags).
No more copying and pasting text links into the address bar! This extension makes your browsing experience smoother, making all visible links instantly clickable.
- ๐ Smart Link Conversion: Real-time scanning of web page content, automatically recognizing and replacing text in the following formats:
- URLs with protocols (e.g.,
https://,http://,ftp://) - Common domain formats without protocols (e.g.,
www.example.com,example.com/page) - Email addresses (e.g.,
[email protected])
- URLs with protocols (e.g.,
- โก Real-time Dynamic Processing: Handles not only content loaded during page load but also new content inserted via AJAX or JavaScript (scrolling, "load more", client-side route changes).
- ๐ง Smart Exclusion: Skips text already inside hyperlinks, and content within
<pre>,<code>,<script>,<style>,<textarea>andcontenteditableregions โ so code blocks, page styling and your own typing stay untouched. - ๐ ๏ธ Opt-in per site: Nothing is modified by default. Turn the toggle on for the current site in the popup; subdomains are covered (enabling
github.comalso coversdocs.github.com) and the list can be managed in bulk from the options page. - ๐ Security & Performance: Fast and efficient conversion process, all operations are performed locally, won't significantly impact browsing speed, and no data is collected.
Visit our website for more information: https://smart-linkify.vercel.app/
Website source code is located in the website/ directory.
- Visit Chrome Web Store to install the extension
- Click the "Add to Chrome" button
- Click "Add extension" in the confirmation dialog
-
Clone or download this repository:
git clone https://github.com/shiroixw/Smart-Linkify.git
-
Open
chrome://extensionsin Chrome browser -
Enable the "Developer mode" switch in the top right corner
-
Click the "Load unpacked" button
-
Select the
extensionfolder in the project to complete installation
After installation the extension does not touch any page yet โ you opt in per site first.
-
Enable for a site: Click the extension icon in the toolbar and turn on the toggle for the current site. The page reloads, and from then on plain text URLs on that site become clickable.
-
See the count: The number badge on the toolbar icon shows how many links were converted on the current page; the popup shows the same number.
-
Settings: Click Settings in the popup, or right-click the icon and choose Options, where you can:
- Choose whether converted links open in a new tab
- Manage the enabled-sites list (one domain per line)
- Customize excluded HTML tags
- Toggle strict matching and file-extension exclusion to avoid matching version numbers, statistics or
config.json - Switch UI theme and language
On an enabled site, this text:
Visit our website www.example.com or email [email protected]
For more info see https://github.com/example/project
becomes:
Visit our website [www.example.com] or email [[email protected]]
For more info see [https://github.com/example/project]
(Text in brackets becomes clickable hyperlinks; on sites that are not enabled nothing changes)
All forms of contributions are welcome! If you want to participate in project development, report bugs, or suggest features, please follow these steps.
-
Clone the repository:
git clone https://github.com/shiroixw/Smart-Linkify.git cd Smart-Linkify -
Load in Chrome:
- Open
chrome://extensions - Ensure "Developer mode" is enabled
- Click "Load unpacked" and select the
extension/directory
- Open
-
Refresh after code changes:
- Click the refresh button for the extension on the
chrome://extensionspage - Or reload the extension
- After editing
content.js, also reload the target page (content scripts are not hot-reloaded)
- Click the refresh button for the extension on the
Smart-Linkify/
โโโ extension/ # Chrome extension (load this folder)
โ โโโ manifest.json
โ โโโ background.js # Service worker: config migration, allow-list, badge
โ โโโ content.js # Content script: DOM walking and conversion
โ โโโ lib/ # Pure modules, directly testable in Node
โ โ โโโ linkify.js # URL / email detection
โ โ โโโ dom-rules.js # Exclusion rules
โ โ โโโ config.js # Config defaults (single source)
โ โโโ shared/ # Cross-page assets
โ โ โโโ tokens.css # Design tokens (color/space/radius/motion)
โ โ โโโ theme.js # Theme resolution (auto -> light/dark)
โ โ โโโ link.css # Injected link styles
โ โโโ popup.* # Popup
โ โโโ options.* # Options page
โ โโโ welcome.* # First-run page
โ โโโ icons/ # icon.svg is the vector source, PNG set is generated
โโโ website/ # Static marketing site
โโโ test/ # node:test unit tests
โโโ scripts/ # Version sync, git hooks, icon generation
โโโ docs/superpowers/ # Design and analysis documents
โโโ .github/workflows/ci.yml # CI: tests / lint / type check
npm test # node:test unit tests
npx eslint . # ESLint
npx tsc -p jsconfig.json # JSDoc type check (covers extension/lib)The project has no runtime dependencies, so the toolchain is intentionally not listed in package.json; npx fetches it on first use. CI (.github/workflows/ci.yml) runs all three on every PR, plus manifest JSON validity and version consistency.
The canonical version is the version field in package.json. Use npm version patch|minor|major to bump; the version lifecycle script runs npm run sync-version, which updates extension/manifest.json, website/index.html, and the Version badges in README.md / README.zh-CN.md. If you edit package.json manually, run npm run sync-version before committing (also runs from the pre-commit hook).
- Fork this repository
- Create a new feature branch (
git checkout -b feature/FixUrlRegex) - Commit your changes (
git commit -m 'Improve URL matching regex') - Push to the branch (
git push origin feature/FixUrlRegex) - Create a Pull Request
Default: one PR per change, every base is main. PRs can then be reviewed in parallel and merged in any order.
Stack pull requests only when the dependency is real:
| Situation | What to do |
|---|---|
| Two changes are independent (they merely touch the same file) | Separate PRs, both based on main |
| B cannot build or run without A | Two-layer stack: A merges first, then B |
| You are only worried about merge conflicts | Not a reason to stack โ merge A, then branch off main again |
Hard rule, independent of tooling:
- Never push to a branch whose PR is already merged. Those commits belong to no pull request (this bit us once: everything looked merged, yet
mainnever received the change). Open a new branch frommaininstead.
Cost of stacking: merges become ordered, and updating a lower layer rewrites the layers above it โ which force-pushes them and dismisses existing approvals. Keep stacks shallow, and only for real dependencies.
GitHub ships a first-party extension for the mechanical part:
gh extension install github/gh-stack # one-off
gh stack init # start a stack from the current branch
gh stack add <branch> # stack another layer on top
gh stack submit # create/update the chain (each PR's base = the branch below it)
gh stack sync # after a lower PR merges: cascade rebase, re-link, prune merged branches
gh stack merge # merge the stack bottom-up in one gosync is not a daemon โ someone has to run it after the parent PR lands. If a stack was created by hand, the closing move is gh pr edit <child> --base main.
- Follow JavaScript ES6+ standards; put new logic in
extension/lib/with unit tests - Keep code concise and readable, comment where it matters
- Before committing, make sure
npm test,npx eslint .andnpx tsc -p jsconfig.jsonare green - Test new features on real websites, especially
contenteditableand Shadow DOM cases - Route colors / spacing / motion through
extension/shared/tokens.cssโ no hardcoded values
- Some websites using Shadow DOM may not work properly
- Rarely conflicts with other extensions
- Text-only updates that reuse an element (
element.textContent = โฆ) are covered by acharacterDataobserver, but extremely fast-updating pages may still miss an occasional update
- Replace
<all_urls>withoptional_host_permissions+ on-demand injection to shrink the install-time permission prompt - Support custom URL matching rules
- Add link preview feature
- Support more protocols such as
file:// - Process very large pages in batches to further reduce main-thread cost
This project is licensed under the MIT License. See LICENSE file for details.
MIT License
Copyright (c) 2024 Smart Linkify โ Instant hyperlink conversion
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Thanks to all developers and users who have contributed to this project!
- Project Homepage: GitHub Repository
- Issue Tracker: GitHub Issues
- Feature Requests: Welcome to share your ideas via Issues
If this project helps you, please give us a โญ๏ธ Star!
Made with โค๏ธ by Smart Linkify โ Instant hyperlink conversion Team