This extension can help you development on Gerrit sites, frontend specifically

Latest Version

Version
1.1.0
Update
December 23, 2023
Size
29.67KiB
Developer
Category
Users
364
Rating
5 ★
Manifest Version
3
Web Store Status
Languages Support
English (United States)
See more
Permissions
ActiveTab
Storage
Tabs
DeclarativeNetRequest
DeclarativeNetRequestWithHostAccess
See more

Gerrit FE Dev Helper Extension

A chrome extension that can help FE developers for Gerrit UI.

source: https://gerrit-review.googlesource.com/q/project:gerrit-fe-dev-helper''
## v1

#### v1.1.0

- Remove support for INJECT_JS_PLUGIN and INJECT_JS_MODULE_PLUGIN.
Content Security Policy for extensions does not allow injecting arbitrary JS.

#### v1.0.2

- Fix injecting JS plugins, remove webcomponents-lite.js

#### v1.0.1

- Fix rules to also work with non-Google hosted Gerrit
- Add a `inject css` rule
- P1 fix: Continue rules processing after first disabled one

#### v1.0.0

- Migrate to Manifest V3
- Restrict the permissions to only run on a specific list of hosts
- Migrate the background script to a service worker
- Migrate request/response manipulation to `chrome.declarativeNetRequest` API
- New default rules
- Remove support for INJECT_HTML_PLUGIN (obsolete)
- Remove support for INJECT_JS_CODE (unsupported by Manifest V3)
- Convert HTML snippets to Lit elements
- Add prettier config and reformat all files
- Bumped lit version to 3.1.0

## v0

#### v0.0.13/14

- Fix `content_scripts.matches` patterns

#### v0.0.12

- Restrict the extension to only work for Google hosted Gerrit
- Add documentation about testing and publishing the extension

#### v0.0.11

- Fix CORS preflight interception
- Update npm deps
- Make the extension look a bit nicer

#### v0.0.10

- Bumped lit version to 2.2.3

#### v0.0.9

- Move cors / cache override to rules, so user can disable it from the popup
- Change header value separator from `,` to `|`, as `,` can be part of the value while `|` is unlikely
- Fix `onGerritReady` to use tag name instead of id and max at 5s ;)

#### v0.0.8

- **BREAKING CHNAGE**: Gerrit is moving to `gr-app.js` only, so `gr-app.html` will no longer exists, we have updated default rules to forward to `gr-app.js` as well, in case you are still using `gr-app.html`, please modify that redirect rule by changing `gr-app.js` to `gr-app.html`
- Add `addRespHeader` operator, thanks to Edward
- Add `injectExp` operator, as gerrit now supports experiments, this is a quick way to force enabling certain experiments, experiments should be separated by `,`

#### v0.0.7

- Fix the issue when multiple rule matches one url for onBeforeRequest
- Block will always take the highest priority
- Then Redirect
- Ignore the rest
- Add a new operator as `injectJsModule`, with plugins moving to polymer 3, certain plugins will be written in modules, and to inject moduled js plugins, use this rule
- This will basically add a `type=\"module\"` to the script tag when load the script so we can use `import` inside
- With `type=\"module\"`, `document.currentScript` will become `null` so we won't be able to infer the plugin url, to workaround this, make sure you call `Gerrit.install` with the third parameter: `Gerrit.install(() => {}, undefined, 'the_url')` so Gerrit can treat it as a legit plugin
- Keep using `injectJsPlugin` if its a single bundled js file

#### v0.0.6

- Add two new operators:
- `addReqHeader` to add arbitrary header when you send a request
- `rRespHeader` to remove arbitrary header on any response
- Modify default rules to show # of js errors in the helper tip
- Add a new default rule to send x-test-origin with gerrit-fe-dev-helper on all requests when enabled

#### v0.0.5

- set crossorigin to anonymous to help debug js error from plugin
- improve the ui on popup
- remove outdated rule of replacing gr-app-p2 with gr-app

#### v0.0.4

- A better way to wait for Gerrit when injecting html plugins

#### v0.0.3

- Hotfix

#### v0.0.2

- Remove restriction on gerrit sites (some features won't work if its not a valid gerrit site)
- Update README

#### v0.0.1

- Enable the extension with a single click
- Allow export / import rules
- Show a error for 5s if rule destination is invalid (can not reach)
- Show an announcement for the change for 3 seconds for first time users
- Persist enable / disable state per tab
- Support temporary disable rule without deleting it
- Move injection to document_end
- Support reset to reset rules to initial state
- Support proxy live requests to local on googlesource sites
- Support 6 types of rules: redirect, block, injectJS code/url, inject html code / url
- Support add / remove / modify rules
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx", "manifest_version": 3, "name": "Gerrit FE Dev Helper", "description": "This extension can help you development on Gerrit sites, frontend specifically", "version": "1.1.0", "action": { "default_icon": "gray-32.png", "default_title": "Gerrit FE Dev Helper" }, "background": { "service_worker": "service_worker.js", "type": "module" }, "content_scripts": [ { "run_at": "document_end", "matches": [ "https://*.git.corp.google.com/*", "https://*.staging-git.corp.google.com/*", "https://*.googlesource.com/*", "https://gerrit.libreoffice.org/*", "https://gerrit.linuxfoundation.org/*", "https://gerrit.wikimedia.org/*", "https://mo-repo.de/*", "https://review.gerrithub.io/*", "https://review.opendev.org/*" ], "js": [ "content_script.js" ] } ], "web_accessible_resources": [ { "resources": [ "elements.js" ], "matches": [ "https://*/*" ] } ], "content_security_policy": { "extension_pages": "script-src 'self'; object-src 'self';" }, "permissions": [ "activeTab", "storage", "tabs", "declarativeNetRequest", "declarativeNetRequestWithHostAccess" ], "host_permissions": [ "https://*.git.corp.google.com/*", "https://*.staging-git.corp.google.com/*", "https://*.googlesource.com/*", "https://gerrit.libreoffice.org/*", "https://gerrit.linuxfoundation.org/*", "https://gerrit.wikimedia.org/*", "https://mo-repo.de/*", "https://review.gerrithub.io/*", "https://review.opendev.org/*" ]}
Read more

Similar Extensions

icon

Dev Playground Extension · Developer Tools 364 2 ★ 288KiB

icon

Recent Crbugs Extension · Productivity 364 2 ★ 488KiB

icon

Highlight Me in Buildbot Extension · Developer Tools 364 1 ★ 38.77KiB

icon

Flake linker Extension · Developer Tools 364 2 ★ 21.02KiB

icon

Gerrit for Gmail Extension · Productivity 364 1 ★ 118KiB

icon

Gerrit JIRA Link Extension · Productivity 364 4 ★ 321KiB

icon

WikimediaDebug Extension · Developer Tools 364 3 ★ 145KiB

icon

gist-more-url Extension · Developer Tools 364 1 ★ 61.76KiB

icon

Hacker News Duplicate Detector Extension · Accessibility 364 1 ★ 21.7KiB

icon

Gerrit Plus - UI fixes for PolyGerrit UI Extension · Developer Tools 364 0 ★ 10.99KiB

icon

Source Quicklinks Extension · Developer Tools 364 2 ★ 59.23KiB

icon

Gerrit Monitor Extension · Developer Tools 364 6 ★ 41.11KiB

icon

Chromite Butler Extension · Developer Tools 364 18 ★ 30.32KiB

icon

Chromium Dev Refresh Extension · Developer Tools 364 0 ★ 13.22KiB

icon

Atma.js DevTool Extension · Developer Tools 364 0 ★ 201KiB

icon

LL Developer Tools Extension · Developer Tools 364 1 ★ 98.88KiB

icon

Chrome OS Tree Status Extension · Developer Tools 364 2 ★ 68.71KiB

icon

The-M-Project Inspector Extension · Developer Tools 364 4 ★ 12.79KiB

icon

nShell Extension · Developer Tools 364 0 ★ 4.76MiB

icon

Git Mining Extension · Productivity 364 4 ★ 211KiB

icon

GitHub submodule links Extension · Developer Tools 364 2 ★ 17.49KiB

icon

GitHub Enhancement Suite Extension · Developer Tools 364 1 ★ 56.24KiB

icon

Lavaca Developer Tools Extension · Developer Tools 364 0 ★ 10.42MiB

User reviews

icon

Nasser Grainawi (ID: 0000008765fd40da) Voted 5 ★ - Updated 11/14/2019 Makes debugging my plugin code so easy!

icon

Paladox none (ID: 0000009b8bc15cb3) Voted 5 ★ - Updated 11/13/2019 Allows users to edit the .js/html files directly on the local system and it will show the changes immediately on a page reload without having to run ./polygerrit-ui/run-server.sh again.