{"id":15080648,"url":"https://github.com/jingmatrix/chromext","last_synced_at":"2025-05-15T07:03:52.277Z","repository":{"id":64906081,"uuid":"576817130","full_name":"JingMatrix/ChromeXt","owner":"JingMatrix","description":"UserScript and DevTools supports for Chromium based and WebView based browsers","archived":false,"fork":false,"pushed_at":"2025-05-13T08:39:05.000Z","size":12709,"stargazers_count":821,"open_issues_count":10,"forks_count":47,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-15T07:03:49.593Z","etag":null,"topics":["android","brave","brave-browser","bromite","browser","chrome","chromium","chromium-browser","eruda","google-chrome","lsposed","microsoft-edge","samsung-internet","thorium-browser","userscript","vivaldi","webview","xposed-module"],"latest_commit_sha":null,"homepage":"https://jingmatrix.github.io/ChromeXt/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JingMatrix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-12-11T04:17:38.000Z","updated_at":"2025-05-12T14:01:54.000Z","dependencies_parsed_at":"2023-10-24T16:37:44.592Z","dependency_job_id":"4aacf475-6a3a-44c6-b0ae-7388a0088536","html_url":"https://github.com/JingMatrix/ChromeXt","commit_stats":{"total_commits":823,"total_committers":5,"mean_commits":164.6,"dds":0.007290400972053468,"last_synced_commit":"7b53bb792a252a11dac011d98547538aad34cca2"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":"KyuubiRan/EzXHepler-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FChromeXt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FChromeXt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FChromeXt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FChromeXt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JingMatrix","download_url":"https://codeload.github.com/JingMatrix/ChromeXt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291974,"owners_count":22046425,"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":["android","brave","brave-browser","bromite","browser","chrome","chromium","chromium-browser","eruda","google-chrome","lsposed","microsoft-edge","samsung-internet","thorium-browser","userscript","vivaldi","webview","xposed-module"],"created_at":"2024-09-25T05:04:33.441Z","updated_at":"2025-05-15T07:03:52.256Z","avatar_url":"https://github.com/JingMatrix.png","language":"Kotlin","readme":"# ChromeXt\n\n[![Build](https://img.shields.io/github/actions/workflow/status/JingMatrix/ChromeXt/android.yml?branch=master\u0026logo=github\u0026label=Build\u0026event=push)](https://github.com/JingMatrix/ChromeXt/actions/workflows/android.yml?query=event%3Apush+is%3Acompleted+branch%3Amaster) [![Download](https://img.shields.io/github/v/release/JingMatrix/ChromeXt?color=orange\u0026logoColor=orange\u0026label=Download\u0026logo=DocuSign)](https://github.com/JingMatrix/ChromeXt/releases/latest) [![Total](https://shields.io/github/downloads/JingMatrix/ChromeXt/total?logo=Bookmeter\u0026label=Counts\u0026logoColor=yellow\u0026color=yellow)](https://github.com/JingMatrix/ChromeXt/releases)\n\nAdd UserScript and DevTools supports to Chromium based and WebView based browsers using Xposed framework.\n\n##  How does it work?\n\nWe hook the `onUpdateUrl` function in [UserScript.kt](app/src/main/java/org/matrix/chromext/hook/UserScript.kt),\nadd URL comparison there and evaluate JavaScript using the `javascript:` scheme (or DevTools Protocol when possible).\n\nChromium based browsers,\nsuch as [Egde](https://www.microsoft.com/en-us/edge/download),\n[Bromite](https://github.com/bromite/bromite),\n[Samsung Internet](https://en.wikipedia.org/wiki/Samsung_Internet),\nand [Brave](https://github.com/brave/brave-browser), are fully supported.\n\nMost WebView based browsers are also supported, if not, please report it.\nNote for WebView based browsers users: you _only_ need to enable this module for the browser application you wish to use, _not_ for any possible WebView applications, _neither_ for the Android system.\n\n## Usage\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://www.youtube.com/watch?v=1Qm4dU-XnJM\"\u003e\u003cimg src=\"https://img.youtube.com/vi/1Qm4dU-XnJM/0.jpg\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\nChromeXt requires **Xposed framework**.\n\nFor root users, install [LSPosed](https://github.com/JingMatrix/LSPosed) first,\npick up the latest built APK from my repo's [GitHub Actions](https://github.com/JingMatrix/ChromeXt/actions) and install it.\n\nFor non-root users,\nI modify a bit [LSPatch](https://github.com/JingMatrix/LSPatch) to support `ChromeXt`; here is how to use it:\n1. Download the latest `lspatch-release` from my [GitHub Actions](https://github.com/JingMatrix/LSPatch/actions).\n2. Download the latest `ChromeXt.apk` from my [GitHub Actions](https://github.com/JingMatrix/ChromeXt/actions).\n3. Extract previously downloaded files to get files `lspatch.jar` (with some suffix) and `ChromeXt-signed.apk`.\n4. Patch your APK (taking `arm64_ChromePublic.apk` as example) using the following command: `java -jar lspatch.jar arm64_ChromePublic.apk -d -v -m ChromeXt-signed.apk --force --injectdex`. If `java` environment is not available, please consider using the provided `manager` APK (and check the `Inject loader dex` option).\n5. Install the patched APK, which might require you to first uninstall the one on your devices.\n\nNotes: currently _to download_ files from `GitHub Actions`, one needs to log in GitHub.\n\nThe author uploads releases to [Xposed-Modules-Repo](https://github.com/Xposed-Modules-Repo/org.matrix.chromext/releases) when needed, but not that frequently.\n\nYou can then install UserScripts from popular sources: URLs that ends with `.user.js`.\n\n### Supported API\n\nCurrently, ChromeXt supports almost all [Tampermonkey APIs](https://www.tampermonkey.net/documentation.php?locale=en):\n\n1. @name (colons not allowed), @namespace, @description and so on\n2. @match (conform to the [Chrome Standard](https://developer.chrome.com/docs/extensions/mv2/match_patterns/), supports [regular expressions](https://developer.android.com/reference/java/util/regex/Pattern))\n3. @include = @match, @exclude\n4. @run-at: document-start, document-end, document-idle (the default and fallback value)\n5. @grant: GM_addStyle, GM_addElement, GM_xmlhttpRequest, GM_openInTab, GM_registerMenuCommand (shown in the `Resources` panel of eruda), GM_unregisterMenuCommand, GM_download, unsafeWindow (= window)\n6. @grant: GM_setValue, GM_getValue (less powerful than GM.getValue), GM_listValues, GM_addValueChangeListener, GM_removeValueChangeListener, GM_setClipboard, GM_cookie, GM_notification, window.close\n7. @require, @resource (without [Subresource Integrity](https://www.tampermonkey.net/documentation.php#api:Subresource_Integrity))\n8. @inject-into, @sandox: by default, imported scripts using `@require` can define/overwrite global JavaScript objects; one can set `@inject-into content` or `@sandbox DOM` to disable this behavior\n9. @noframes: note that, to load UserScripts for frames, there must be a script with `@grant frames` on the main page\n\nThese APIs are implemented differently from the official ones, please refer to the source files\n[Local.kt](app/src/main/java/org/matrix/chromext/script/Local.kt) and\n[GM.js](app/src/main/assets/GM.js) if you have doubts or questions.\n\nMoreover, there is the powerful (also dangerous) `GM.ChromeXt` API, which must be declared by `@grant GM.ChromeXt` to _unlock_ its usage.\nIt is locked by default so that the users are protected from malicious UserScripts exploiting ChromeXt.\nThis API allows scripts to use the JavaScript method `ChromeXt.dispatch(action, payload)`, which is fundamental to implement other APIs. (Hence, one can find usage examples in [GM.js](app/src/main/assets/GM.js)).\nDispatched `action` and `payload` are handled by [Listener.kt](app/src/main/java/org/matrix/chromext/Listener.kt).\n\n### UserScripts manager front end\n\nTo manage scripts installed by `ChromeXt`, here are a simple front end hosted on [github.io](https://jingmatrix.github.io/ChromeXt/) and two mirrors of it (in case that you have connection issues): [onrender.com](https://jianyu-ma.onrender.com/ChromeXt/), [netlify.app](https://jianyu-ma.netlify.app/ChromeXt/).\n\n### Edit scripts before installing them\n\nIf you cancel the prompt of installing a new UserScript, then you can edit it directly in Chrome.\nUse the `Install UserScript` page menu to install your modified UserScript.\n\n### DevTools for developers\n\nFrom the three dots page menu, ChromeXt offers you the\n1. `Developer tools` menu for the UserScript manager front end,\n2. `Eruda console` menu for other pages.\n\nFor `Edge` browser, these menus are moved to the page info menu,\nwhich locates at the left corner inside the URL input bar.\n\nFor WebView based browsers and _Samsung Internet_, these menu items are presented in the context menu.\n\n## Bonus\n\nSince WebView based browsers have no unified designs, the following\nfirst four features are not supported for them.\n(By the same reason, they are neither supported for _Samsung Internet_.)\n\n### Open in Chrome\n\nThe application `ChromeXt` is able to\n1. received shared texts to search them using `Google`,\n2. open JavaScript files to install them as UserScripts.\n\nThe reversed priority order of opening which Chromium based browsers is given in [AndroidManifest.xml](app/src/main/AndroidManifest.xml).\n\n### Solution of system gesture conflicts\n\nBy default, the history forward gesture of Chrome is available near the vertical center of screen.\nOn other areas, only the system gesture is available.\nOne can disable this behavior through the `Developer options` menu.\n(Tap seven times on the Chrome version from the Chrome settings, you will see the `Developer options` menu.)\n(In [Vivaldi](https://vivaldi.com/en/android/) browsers, `Developer options` menu is removed by its developers.)\n\n### Enable reader mode manually\n\nChromeXt adds a book icon in the page menu to enable reader (distiller) mode manually.\n\n### Export browser bookmarks\n\nBookmarks can be exported in HTML format through the `Developer options` menu.\n\n### AD Blocker solution\n\nFor blocking network requests, I recommend to use `AdAway` or any proxy AD Blocker such as `clash`.\n\nA content cosmetic blocker is embedded into ChromeXt with the help of eruda.\nTo use it, first open the `Eruda console`.\nIn the `Elements` panel, one can use the `pointer` icon to select elements on the page.\nAfter clicking the `delete` icon for a selected element, a corresponding filter will be saved to the `Resources` panel,\nwhere one can manage previous added filters.\nThese filters are saved in the browser even after clearing the site's data.\n\nAnother way to block ADs is using the [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src) to block some scripts from loading.\n\n### User-Agent spoofing\n\nOne can edit the User-Agent from the `Info` panel of `Eruda console`.\nA valid User-Agent should contain only ASCII characters.\nCurrently, ChromeXt only changes the `User-Agent` HTTP header, which\nworks well but is [deprecated](https://wicg.github.io/ua-client-hints/#user-agent).\n\nFor Chromium based browsers, when the User-Agent spoofing is not taking effects, refresh the page using the reload button in the page menu.\n(By contrast, a swipe refresh might be insufficient.)\n\nNote that the DevTools can also change User-Agent.\n\n## Contribute to this project\n\nBefore you submit your pull-requests, please ensure that the command\n`./gradlew build` or `gradlew.bat build` produces no warnings and no errors.\n\nHere are corresponding files you might want / need to change:\n1. Front end: [manager.vue](https://github.com/JingMatrix/jingmatrix.github.io/tree/main/components/ChromeXt/manager.vue)\n2. Tampermonkey API: [Local.kt](app/src/main/java/org/matrix/chromext/script/Local.kt)\nand [GM.js](app/src/main/assets/GM.js)\n3. Eruda configuration: [eruda.js](app/src/main/assets/eruda.js)\n4. Support more WebView based browsers: [WebView.kt](app/src/main/java/org/matrix/chromext/hook/WebView.kt)\n\n## Development plans\n\n- [x] Make it possible to pass intents to Chrome with `file` scheme\n- [x] Fix encoding problem for Chrome downloaded JavaScript files\n- [x] Inject module resource into Chrome\n- [x] Implement developer tools\n- [x] Use local versions of [eruda](https://github.com/liriliri/eruda)\n- [x] Improve eruda incorporation with Chrome\n- [x] Add more information in the preference screen\n- [x] Support more [Tampermonkey API](https://www.tampermonkey.net/documentation.php)s\n- [x] Find elegant way to support DevTools for Android 11-\n- [x] Add cosmetic AdBlocker using eruda\n- [x] Find way to get current interactive tab\n- [x] Remove AndroidX Room dependency to reduce app size\n- [x] Support non-split version of Android Chrome\n- [x] Solve the menu hook problem for non-split versions\n- [x] Handle multiple Tab Model\n- [x] Forward DevTools server socket\n- [x] A mobile friendly DevTools front end\n- [x] Allow user to trigger reader mode\n- [x] Support @resource API\n- [x] Make GestureNav Fix optional\n- [x] Add an open source License\n- [x] Support mocking User-Agent\n- [ ] ~~Support [urlFilter](https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-RuleCondition) syntax~~\n- [x] Improve `Open in Chrome` function\n- [x] Implement fully `GM_info`\n- [x] Eruda fails due to [Injection Sinks](https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API)\n- [x] Hide page_info panel automatically\n- [x] Fix page menu injection position\n- [ ] ~~Use [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) as UserScript engine~~\n- [ ] ~~Use `adb forward` to support non-root users~~\n- [x] Fully support WebView based browsers\n- [x] Fix [LSPatch for isolated process](https://github.com/LSPosed/LSPatch/issues/190) issue\n- [x] Implement UserScript storage\n- [x] Re-implement GM_xmlhttpRequest\n- [x] Convert exported bookmarks to HTML format\n- [x] Show executed scripts on current page\n- [x] Make a YouTube presentation video\n- [x] Support Samsung Internet browser\n- [x] Implement GM_cookie\n- [x] Improve valid UserScripts Url detection\n- [ ] Save and present script errors and `GM_log` logs\n- [ ] Use `iframe` and local server to run general [WebExtensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions)\n- [ ] Bypass `style-src` rule for `eruda`, such as Mastodon\n- [ ] Support importing UserScripts from Tampermonkey exports\n- [ ] Support backup and restore\n- [ ] Add recommended UserScripts to the front end manager\n- [x] Add [chrome devtools front-end](https://chromium.googlesource.com/devtools/devtools-frontend/) for Edge, see [devtools_http_handler.cc](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_http_handler.cc) as reference.\n- [x] Hide inserted menu for non-page\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingmatrix%2Fchromext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingmatrix%2Fchromext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingmatrix%2Fchromext/lists"}