Skip to content

Commit

Permalink
Fixing the stage at which scripts are injected
Browse files Browse the repository at this point in the history
  • Loading branch information
modos189 committed Apr 20, 2019
1 parent 30b9b9a commit 35b033c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ h2:first-letter {
.local-server__input {
box-sizing: border-box;
width: 50%;
padding: 5px 3px;
flex: auto;
font-weight: 500;
transition: color 0.2s linear;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extName__",
"description": "__MSG_extDescription__",
"version": "1.0.1",
"version": "1.0.2",
"minimum_chrome_version": "61",
"applications": {
"gecko": {
Expand Down
8 changes: 4 additions & 4 deletions scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ function initialize(tabId) {
if ((status === undefined || status === true) && iitc_code !== undefined) {

chrome.tabs.executeScript(tabId, {
runAt: "document_idle",
runAt: "document_end",
file: './scripts/pre.js'
}, () => {
loadJS(tabId, "document_idle", iitc_code, function () {
loadJS(tabId, "document_end", iitc_code, function () {
activeIITCTab = tabId;

let plugins_local = data[updateChannel+'_plugins_local'];
if (plugins_local !== undefined) {
Object.keys(plugins_local).forEach(function(id) {
let plugin = plugins_local[id];
if (plugin['status'] === 'on') {
loadJS(tabId, "document_idle", plugin['code'], function () {
loadJS(tabId, "document_end", plugin['code'], function () {
console.info('plugin %s loaded', id);
});
}
Expand All @@ -184,7 +184,7 @@ function initialize(tabId) {
Object.keys(plugins_user).forEach(function(id) {
let plugin = plugins_user[id];
if (plugin['status'] === 'on') {
loadJS(tabId, "document_idle", plugin['code'], function () {
loadJS(tabId, "document_end", plugin['code'], function () {
console.info('userscript %s loaded', id);
});
}
Expand Down

0 comments on commit 35b033c

Please sign in to comment.