{"id":43762582,"url":"https://github.com/raindropio/highlight","last_synced_at":"2026-02-05T15:09:05.701Z","repository":{"id":246543531,"uuid":"821402136","full_name":"raindropio/highlight","owner":"raindropio","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-17T13:26:48.000Z","size":1365,"stargazers_count":12,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-17T15:19:22.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raindropio.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-28T13:08:25.000Z","updated_at":"2025-11-17T13:26:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b1dd047-68b6-461e-a9e3-9382e129e495","html_url":"https://github.com/raindropio/highlight","commit_stats":null,"previous_names":["raindropio/highlight"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raindropio/highlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raindropio%2Fhighlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raindropio%2Fhighlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raindropio%2Fhighlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raindropio%2Fhighlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raindropio","download_url":"https://codeload.github.com/raindropio/highlight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raindropio%2Fhighlight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29124793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-02-05T15:09:04.986Z","updated_at":"2026-02-05T15:09:05.692Z","avatar_url":"https://github.com/raindropio.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Highlight\n```\nnpm i\nnpm run build\ncd dist/\n```\n\n### Subscribe to events\n    - { type: 'RDH_READY', payload: { url } }               Highlighter is ready to receive incoming msgs\n    - { type: 'RDH_ADD', payload: { text, color, note } }   Add new highlight\n    - { type: 'RDH_UPDATE', payload: { _id, note... } }     Update specific highlight, only updated fields are present in payload!\n    - { type: 'RDH_REMOVE', payload: { _id } }              Remove specific highlight\n\n### Supported events\n    - { type: 'RDH_CONFIG', payload: { enabled: true, nav: true, pro: true } }\n    - { type: 'RDH_APPLY', payload: [[...{_id, text, color, note}]] }\n    - { type: 'RDH_SCROLL', payload: { _id } }\n    - { type: 'RDH_ADD_SELECTION' }\n    - { type: 'RDH_NOTE_SELECTION' }\n\n### Use as an webextension inject script\nExample in `test/webextension` folder\n\n```js\n    browser.runtime.onMessage.addListener(({ type, payload }, sender)=\u003e{\n        if (sender.id != browser.runtime.id || typeof type != 'string') return\n    })\n\n    browser.tabs.sendMessage(sender.tab.id, { type: 'some', payload: {} })\n```\n\n### Iframe\nExample in `test/iframe` folder\n\n```js\n    window.addEventListener('message', ({data, source}) =\u003e {\n        if (typeof data != 'object' || typeof data.type != 'string') return\n        const { type, payload } = data\n    })\n\n    iframe.postMessage({ type: 'some', payload: {} }, '*')\n```\n\n### Use in electron\nExample in `test/electron` folder\n\n```js\n    \u003cwebview src=\"...\" preload=\"./highlight.js\"\u003e\u003c/webview\u003e\n\n    webview.addEventListener('ipc-message', ({ channel, args=[] }) =\u003e {\n        if (channel != 'RDH') return\n        const [{ type, payload }] = args\n    })\n\n    webview.send('RDH', { type: 'some', payload: {} })\n```\n\n### Use in React Native\n```js\n    \u003cWebView \n        ref={ref}\n        onMessage={({ nativeEvent })=\u003e{\n            const data = JSON.parse(nativeEvent.data)\n            if (typeof data != 'object' || typeof data.type != 'string') return\n            const { type, payload } = data\n        }} /\u003e\n\n    import js from './highlight.string.js'\n    ref.current.injectJavaScript(`${js}; true`)\n\n    ref.current.injectJavaScript(`window.ReactNativeWebViewSendMessage(${JSON.stringify({ type: 'some', payload: {} })}); true`)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraindropio%2Fhighlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraindropio%2Fhighlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraindropio%2Fhighlight/lists"}