Release v0.0.5
changes:
- 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
Change-Id: I7b46d61a176f4dcc840fb482ae8274939cb94f03
diff --git a/data/rules.json b/data/rules.json
index 2386107..06f681a 100644
--- a/data/rules.json
+++ b/data/rules.json
@@ -32,12 +32,6 @@
{
"disabled": false,
"target": "",
- "operator": "injectJSCode",
- "destination": "\n const app = document.createElement(\"gr-app\");\n app.id = \"app\";\n document.querySelector(\"#app\").replaceWith(app);\n "
- },
- {
- "disabled": false,
- "target": "",
"operator": "injectHtmlCode",
"destination": "<span style=\"color: white;font-weight:bold;padding:10px;z-index:10000;display:block;position:fixed;bottom:0;right:0;background-color:red;\">Gerrit dev helper is enabled</span>"
}
diff --git a/release-notes.md b/release-notes.md
index c3b2f9f..e27b48b 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -1,3 +1,9 @@
+#### 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
diff --git a/src/content_script.ts b/src/content_script.ts
index 0caabb6..e0fa3e7 100644
--- a/src/content_script.ts
+++ b/src/content_script.ts
@@ -49,6 +49,7 @@
onGerritReady().then(() => {
const link = document.createElement('script');
link.setAttribute('src', rule.destination);
+ link.setAttribute('crossorigin', 'anonymous');
document.head.appendChild(link);
});
} else if (rule.operator === Operator.INJECT_JS_CODE) {
diff --git a/src/manifest.json b/src/manifest.json
index faec7c2..ba31029 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -1,41 +1,39 @@
{
- "manifest_version": 2,
- "name": "Gerrit FE Dev Helper",
- "description": "This extension can help you development on gerrit sites, frontend specifically",
- "version": "0.0.4",
- "browser_action": {
- "default_icon": "gray-32.png",
- "default_title": "Gerrit FE Dev Helper"
- },
- "background": {
- "scripts": [
- "background.js"
- ],
- "persistent": true
- },
-
- "content_scripts": [
- {
- "run_at": "document_end",
- "matches": [
- "<all_urls>"
- ],
- "js": [
- "content_script.js"
- ]
- }
+ "manifest_version": 2,
+ "name": "Gerrit FE Dev Helper",
+ "description": "This extension can help you development on gerrit sites, frontend specifically",
+ "version": "0.0.5",
+ "browser_action": {
+ "default_icon": "gray-32.png",
+ "default_title": "Gerrit FE Dev Helper"
+ },
+ "background": {
+ "scripts": [
+ "background.js"
],
- "content_security_policy": "default-src 'none'; script-src 'self'; style-src 'unsafe-inline'; connect-src https://*",
- "permissions": [
- "debugger",
- "activeTab",
- "<all_urls>",
- "notifications",
- "storage",
- "tabs",
- "webRequest",
- "webRequestBlocking",
- "declarativeContent"
- ]
- }
-
\ No newline at end of file
+ "persistent": true
+ },
+ "content_scripts": [
+ {
+ "run_at": "document_end",
+ "matches": [
+ "<all_urls>"
+ ],
+ "js": [
+ "content_script.js"
+ ]
+ }
+ ],
+ "content_security_policy": "default-src 'none'; script-src 'self'; style-src 'unsafe-inline'; connect-src https://*",
+ "permissions": [
+ "debugger",
+ "activeTab",
+ "<all_urls>",
+ "notifications",
+ "storage",
+ "tabs",
+ "webRequest",
+ "webRequestBlocking",
+ "declarativeContent"
+ ]
+}
\ No newline at end of file
diff --git a/src/popup.ts b/src/popup.ts
index fa30ecd..9811f90 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -178,14 +178,25 @@
padding: 10px;
}
button {
+ font-family: Roboto, sans-serif;
+ font-size: .875rem;
+ font-weight: 500;
+ text-transform: uppercase;
+ user-select: none;
+ box-sizing: content-box;
+ border-radius: 4px;
+ border: 1px solid #333;
padding: 5px;
+ cursor: pointer;
+ outline: none;
}
-
+ button:hover {
+ background-color: #f4f0fa;
+ }
header {
display: flex;
flex-direction: row-reverse;
}
-
textarea {
min-width: 500px;
min-height: 500px;
@@ -362,6 +373,14 @@
textarea {
flex: 1;
min-width: 220px;
+ outline: none;
+ border: none;
+ border-bottom: 1px solid #ccc;
+ }
+ input[type="text"]:focus,
+ textarea:focus {
+ border-bottom: 1px solid #3c88fd;
+ background: #9dc3fd;
}
input[disabled],
textarea[disabled] {
@@ -396,7 +415,7 @@
render() {
return html`
- <label for="trigger">
+ <label for="trigger" @click=${this.toggleVisible}>
<div class="selected-value">${this.items[this.selectedIndex]}</div>
<input
.checked=${this.isVisible}
@@ -412,6 +431,7 @@
</li>
`)}
</ul>
+ <i></i>
</label>
`;
}
@@ -423,6 +443,21 @@
display: flex;
flex-direction: column;
}
+ label {
+ background-color: #f1f1f1;
+ margin: 0 5px;
+ }
+ i {
+ position: absolute;
+ top: 10px;
+ right: 15px;
+ border: solid #555;
+ border-width: 0 3px 3px 0;
+ display: inline-block;
+ padding: 3px;
+ transform: rotate(45deg);
+ -webkit-transform: rotate(45deg);
+ }
.selected-value {
padding: 8px 15px;
min-width: 100px;
@@ -445,9 +480,11 @@
top: 0;
width: 100%;
height: 100%;
- }
+ cursor: pointer;
+ }
input:checked + ul {
display: block;
+ box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2),0 1px 1px 0 rgba(0, 0, 0, 0.14),0 1px 3px 0 rgba(0,0,0,.12);
}
input:checked + ul li:hover {
background: #ddd;
@@ -460,6 +497,10 @@
input:checked + ul li.active:hover {
background-color: #fff;
}
+ input:checked + ul + i {
+ transform: rotate(-135deg);
+ -webkit-transform: rotate(-135deg);
+ }
`;
}
}