{"id":19529891,"url":"https://github.com/loopmode/react-link","last_synced_at":"2025-02-26T02:43:10.467Z","repository":{"id":140399917,"uuid":"202500083","full_name":"loopmode/react-link","owner":"loopmode","description":null,"archived":false,"fork":false,"pushed_at":"2019-08-15T15:55:53.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T18:02:20.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loopmode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-15T08:04:29.000Z","updated_at":"2019-08-15T15:55:55.000Z","dependencies_parsed_at":"2023-12-10T15:45:28.232Z","dependency_job_id":null,"html_url":"https://github.com/loopmode/react-link","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Freact-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Freact-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Freact-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Freact-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopmode","download_url":"https://codeload.github.com/loopmode/react-link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240783109,"owners_count":19856776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:28:02.824Z","updated_at":"2025-02-26T02:43:10.392Z","avatar_url":"https://github.com/loopmode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @loopmode/react-link\n\nA thin wrapper around the `\u003ca\u003e` tag that allows usage of `javascript:` href.\n\nCurrently, React allows this but already prints a deprecation message: `Warning: A future version of React will block javascript: URLs as a security precaution.`\n(see [PR 15047](https://github.com/facebook/react/pull/15047))\n\n## Motivation\n\nMy original use-case is to render bookmarklets in a react app: Links or buttons users can drag into their browser bookmarks bar. When clicked, these bookmarklets shouldn't navigate; instead, they should execute some function on the current page.\n\n## Installation\n\n```\nyarn add @loopmode/react-link\n```\n\n```\nnpm install --save @loopmode/react-link\n```\n\n## Usage\n\nPlease note that if you're using ESLint, you may still get warnings from the `no-script-url` rule.\nThere are various ways to disable it, for example you could disable the rule at the top of the file that defines the script url.\n\n```jsx\n/* eslint-disable no-script-url */\nimport React from \"react\";\nimport Link from \"@loopmode/react-link\";\n\nexport default function MyBookmarklet() {\n    return (\n        \u003cLink href=\"javascript: (function() {window.console.log('clicked')}())\"\u003e\n            exec javascript function\n        \u003c/Link\u003e\n    );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopmode%2Freact-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopmode%2Freact-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopmode%2Freact-link/lists"}