Removed chrome specific wait for document complete
Replaced with extensions API `run_at` in the manifest.json Updated README.md with Firefox instructions
This commit is contained in:
parent
96356fdd0b
commit
567534dcbd
22
README.md
22
README.md
@ -1,6 +1,6 @@
|
||||
# Conventional Comments button
|
||||
|
||||
This is a tiny Chrome extension that adds a conventional comment button to GitLab file explorer comments, allowing to quickly leave a structured semantic comment during your MR reviews!
|
||||
This is a tiny extension that adds a conventional comment button to GitLab file explorer comments, allowing to quickly leave a structured semantic comment during your MR reviews!
|
||||
|
||||
## Demo
|
||||
|
||||
@ -8,18 +8,34 @@ This is a tiny Chrome extension that adds a conventional comment button to GitLa
|
||||
|
||||
## How to install
|
||||
|
||||
This is a chrome extension, recently chrome disallowed to install packed `crx` extension that are not listed on the Chrome Store, so to install this
|
||||
First, clone this repo `git clone git@gitlab.com:conventionalcomments/conventional-comment-button.git` and then see below for browser specific instructions.
|
||||
|
||||
### Chrome
|
||||
|
||||
Recently chrome disallowed to install packed `crx` extension that are not listed on the Chrome Store, so to install this
|
||||
|
||||
- `git clone git@gitlab.com:conventionalcomments/conventional-comment-button.git`
|
||||
- On Chrome: Menu
|
||||
- More Tools
|
||||
- Extensions
|
||||
- In the Extension page: `Load unpacked` and select the cloned repository
|
||||
|
||||
### Firefox
|
||||
|
||||
- On Firefox: enter `about:debugging#/runtime/this-firefox` into the address bar
|
||||
- In the Extension page: `Load Temporary Add-on...` and select any file within the cloned repository
|
||||
|
||||
## How to update
|
||||
|
||||
- `git pull`
|
||||
|
||||
### Chrome
|
||||
|
||||
- On Chrome: Menu
|
||||
- More Tools
|
||||
- Extensions
|
||||
- In the Extension page find `conventional comments button` and hit the refresh button
|
||||
|
||||
### Firefox
|
||||
|
||||
- On Firefox: enter `about:debugging#/runtime/this-firefox` into the address bar
|
||||
- In the Extension page find `conventional comments button` and hit the reload button
|
||||
|
@ -10,16 +10,13 @@
|
||||
"128": "icons/icon128.png"
|
||||
},
|
||||
"default_locale": "en",
|
||||
"background": {
|
||||
"scripts": ["src/bg/background.js"],
|
||||
"persistent": true
|
||||
},
|
||||
"permissions": ["https://gitlab.com/*"],
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://gitlab.com/*"],
|
||||
"js": ["src/inject/inject.js"],
|
||||
"css": ["src/inject/inject.css"]
|
||||
"css": ["src/inject/inject.css"],
|
||||
"run_at": "document_idle"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
// if you checked "fancy-settings" in extensionizr.com, uncomment this lines
|
||||
|
||||
// var settings = new Store("settings", {
|
||||
// "sample_setting": "This is how you use Store.js to remember values"
|
||||
// });
|
||||
|
||||
//example of using a message handler from the inject scripts
|
||||
chrome.extension.onMessage.addListener(function (
|
||||
request,
|
||||
sender,
|
||||
sendResponse
|
||||
) {
|
||||
sendResponse();
|
||||
});
|
@ -89,7 +89,6 @@ const addSemanticButton = (element) => {
|
||||
parent.appendChild(container);
|
||||
};
|
||||
|
||||
const main = () => {
|
||||
document.addEventListener("click", (e) => {
|
||||
if (
|
||||
e.target.id === "note_note" &&
|
||||
@ -99,13 +98,3 @@ const main = () => {
|
||||
addSemanticButton(e.target);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
chrome.extension.sendMessage({}, (response) => {
|
||||
const readyStateCheckInterval = setInterval(() => {
|
||||
if (document.readyState === "complete") {
|
||||
clearInterval(readyStateCheckInterval);
|
||||
main();
|
||||
}
|
||||
}, 10);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user