Skip to content

Commit

Permalink
Solve issue #70
Browse files Browse the repository at this point in the history
  • Loading branch information
didierfred committed Dec 24, 2023
1 parent cb05a62 commit c255e6e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GreenIT-Analysis (V3.1.2)
# GreenIT-Analysis (V3.1.3)


GreenIT-Analysis est une extension pour navigateur qui vous permet de quantifier les impacts environnementaux d'un parcours utilisateur complet, même derrière un firewall et / ou une authentification applicative. L'outil vérifie également l'utilisation de bonnes pratiques visant à diminuer ces impacts.
Expand Down
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"description": "Launch Analysis"
},
"menuText": {
"message": "GreenIT Analysis V3.1.2 is install in your browser and accessible via the devtool panel (F12 or CMD + ALT + i sur Mac",
"message": "GreenIT Analysis V3.1.3 is install in your browser and accessible via the devtool panel (F12 or CMD + ALT + i sur Mac",
"description": "Text when you click on the plugin's icone"
},
"menuMoreInformation": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"description": "Launch Analysis"
},
"menuText": {
"message": "GreenIT Analysis V3.1.2 est installé et accessible via le panneau développeur (F12 ou CMD + ALT + i sur Mac) ",
"message": "GreenIT Analysis V3.1.3 est installé et accessible via le panneau développeur (F12 ou CMD + ALT + i sur Mac) ",
"description": "Text when you click on the plugin's icone"
},
"menuMoreInformation": {
Expand Down
9 changes: 7 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*
* Copyright (C) 2019-2022 [email protected]
* Copyright (C) 2019-2023 [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -33,6 +33,9 @@ const notify = (message, sender, sendResponse) => {
else console.warn("Tab not found in connection list.");
}
else console.warn("sender.tab not defined.");
// Send response to solve even if not needed to solve issue
// https://bugs.chromium.org/p/chromium/issues/detail?id=1304272
if (sendResponse) sendResponse();
}


Expand All @@ -49,7 +52,6 @@ chrome.runtime.onConnect.addListener((devToolsConnection) => {
// in case message form devtools is to clean cache
if (message.clearBrowserCache) {
clearBrowserCache();
return;
}
// Otherwise message is to inject script
else {
Expand All @@ -58,6 +60,9 @@ chrome.runtime.onConnect.addListener((devToolsConnection) => {
if (!connections[message.tabId]) connections[message.tabId] = devToolsConnection;
injectAnalyseScript(message.tabId,message.scriptToInject);
}
// Send response to solve even if not needed to solve issue
// https://bugs.chromium.org/p/chromium/issues/detail?id=1304272
if (sendResponse) sendResponse();
}
// add the listener
devToolsConnection.onMessage.addListener(devToolsListener);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"description": "GreenIT-Analysis",
"manifest_version": 2,
"name": "GreenIT-Analysis",
"version": "3.1.2",
"version": "3.1.3",
"homepage_url": "https://github.com/didierfred/GreenIT-Analysis",
"icons" : {
"48": "icons/logo-48.png"
Expand Down
2 changes: 1 addition & 1 deletion manifestV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"description": "GreenIT-Analysis",
"manifest_version": 2,
"name": "GreenIT-Analysis",
"version": "3.1.2",
"version": "3.1.3",
"homepage_url": "https://github.com/didierfred/GreenIT-Analysis",
"icons" : {
"48": "icons/logo-48.png"
Expand Down
2 changes: 1 addition & 1 deletion manifestV3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"description": "GreenIT-Analysis",
"manifest_version": 3,
"name": "GreenIT-Analysis",
"version": "3.1.2",
"version": "3.1.3",
"homepage_url": "https://github.com/didierfred/GreenIT-Analysis",
"icons" : {
"48": "icons/logo-48.png"
Expand Down
5 changes: 5 additions & 0 deletions script/greenpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ function openBackgroundPageConnection() {
handleResponseFromBackground(frameMeasures);
refreshUI();
});

backgroundPageConnection.onDisconnect.addListener( () => {
console.warn("Background connection is closed , try to open it again ");
openBackgroundPageConnection();
})
}

function handleResponseFromBackground(frameMeasures) {
Expand Down
2 changes: 1 addition & 1 deletion script/rules/JsValidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function createJsValidateRule() {
},

check: function (measures, resourceContent) {
if (resourceContent.type === "script") {
if (resourceContent.type === "script" && resourceContent.content) {
this.specificMeasures.totalJsSize += resourceContent.content.length;
let errorNumber = computeNumberOfErrorsInJSCode(resourceContent.content, resourceContent.url);
if (errorNumber > 0) {
Expand Down

0 comments on commit c255e6e

Please sign in to comment.