{"id":16115259,"url":"https://github.com/iafan/linktoselection","last_synced_at":"2025-03-18T10:30:30.463Z","repository":{"id":146408046,"uuid":"53355994","full_name":"iafan/LinkToSelection","owner":"iafan","description":"Allow your website visitors to deep-link to any selected page content","archived":false,"fork":false,"pushed_at":"2018-08-24T23:04:36.000Z","size":13,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-28T08:45:55.743Z","etag":null,"topics":["bookmarking","deep-linking","javascript","plugin"],"latest_commit_sha":null,"homepage":"","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/iafan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","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":"2016-03-07T20:17:16.000Z","updated_at":"2021-02-20T15:43:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"75d43d09-dd39-4175-a6ca-78642effff54","html_url":"https://github.com/iafan/LinkToSelection","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/iafan%2FLinkToSelection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iafan%2FLinkToSelection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iafan%2FLinkToSelection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iafan%2FLinkToSelection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iafan","download_url":"https://codeload.github.com/iafan/LinkToSelection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918613,"owners_count":20368745,"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":["bookmarking","deep-linking","javascript","plugin"],"created_at":"2024-10-09T20:18:18.893Z","updated_at":"2025-03-18T10:30:30.458Z","avatar_url":"https://github.com/iafan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### About LinkToSelection\r\n\r\n\r\nSometimes you want to share a link that points to a specific text on a page, or an image.\r\nThis script, when plugged into a page, will do just that.\r\n\r\nUpon selecting something on a page, you will see \u003ccode\u003e#sel:xxxxxxxxxxxx\u003c/code\u003e hash\r\nadded to the page URL. Send the resulting link to someone else, and they will open the\r\npage with the same selection restored and scrolled into view.\r\n\r\n### Best Use Cases\r\n\r\n__Documentation__: enabling selection sharing this on your documentation website will allow you to point others to specific phrases or words.\r\n\r\n__Reporting errors__: your users can send you links to typos or other kinds of errors that they find on your website pages.\r\n\r\n### Demo\r\n\r\nTry any of these links that point to a specific selected content on [serge.io](https://serge.io/) website:\r\n\r\n  * [Link to a phrase](https://serge.io/#sel:ZGl2L2Rpdi4yL2Rpdi4zL2Rpdi9wLjEvQDoxMDctKjoxNjQ)\r\n  * [Link to a section](https://serge.io/docs/dev/callbacks/#sel:I2JlZm9yZV91cGRhdGVfZGF0YWJhc2VfZnJvbV9zb3VyY2VfZmlsZXMvYS1kaXYvZGl2LjIvZGl2L2Rpdi4xL3AuNy9ALjE6MTIw)\r\n  * [Link to an image](https://serge.io/docs/localization-cycle/#sel:ZGl2L2Rpdi4yL2Rpdi9kaXYuMS9wLjItKjox)\r\n\r\n### Usage\r\n\r\nJust put the `LinkToSelection.min.js` file to an appropriate folder of your website, e.g. `/static/js/vendor/` and add the following script to the bottom of your web pages (before the closing `\u003c/body\u003e` tag):\r\n\r\n```html\r\n\u003cscript src=\"/static/js/vendor/LinkToSelection.min.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n### Browser compatibility\r\n\r\nLinkToSelection was tested in:\r\n\r\n  * Desktop:\r\n    * Chrome 48+\r\n    * Firefox 44+\r\n    * Edge 25+\r\n    * Internet Explorer 11\r\n  * iOS:\r\n    * Safari\r\n    * Chrome\r\n  * Android:\r\n    * Chrome\r\n    * Firefox\r\n\r\n### Caveats\r\n\r\nBy their nature, links with encoded selection may not work if the other person who opens such a link sees a page with the different structure. This means that this script will work best on mostly static pages which are not password-protected and are not built on the fly from XHR requests.\r\n\r\nThe script *may* conflict with other scripts that use `document.onselectionchange` event handler or URL hash for their own purposes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiafan%2Flinktoselection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiafan%2Flinktoselection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiafan%2Flinktoselection/lists"}