-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from inuyasha82/dev
Various fixes
- Loading branch information
Showing
5 changed files
with
148 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Parameters Editor", | ||
"version": "1.2", | ||
"version": "1.3", | ||
|
||
"description": "Shows parameters used in the URL and allows to update, export and import them ", | ||
|
||
"permissions": [ | ||
"activeTab", | ||
"webRequest", | ||
"webRequestBlocking", | ||
"*://*/*", | ||
"tabs", "<all_urls>", | ||
"webNavigation" | ||
], | ||
|
||
"background": { | ||
"scripts": ["src/background.js"], | ||
"persistent": false | ||
"persistent": true | ||
}, | ||
|
||
"page_action": { | ||
"default_title": "Show/Edit parameter for this URL", | ||
"default_icon": "images/icon.png", | ||
"default_popup": "src/popup.html" | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,86 @@ | ||
/** | ||
* chrome_parameters Extension | ||
* | ||
* background.js | ||
* | ||
* @version 1.1 | ||
* | ||
*/ | ||
|
||
var tag; | ||
|
||
/** | ||
* Get the url paramater identified by sParam | ||
* @param {String} sParam The parameter that we want to read from url. | ||
* @return The parameter value if available, null otherwise | ||
*/ | ||
function getURLParameter(sParam) { | ||
var sPageURL = window.location.search.substring(1); | ||
var sURLVariables = sPageURL.split('&'); | ||
for (var i = 0; i < sURLVariables.length; i++) { | ||
var sParameterName = sURLVariables[i].split('='); | ||
if (sParameterName[0] == sParam) { | ||
return sParameterName[1]; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | ||
//var url_url = processUrl(tab.url); | ||
console.log("Parameter: " + tab.url); | ||
var i = 0; | ||
console.log(tab.url.length); | ||
var i = tab.url.indexOf('?'); | ||
var parameter_url = tab.url.substring(i++); | ||
chrome.pageAction.show(tabId); | ||
}); | ||
|
||
function getVersion(){ | ||
var extension_version = chrome.app.getDetails(); | ||
return extension_version.version; | ||
} | ||
|
||
function onInstall(){ | ||
console.log("Extension Installed"); | ||
chrome.tabs.create({'url': chrome.extension.getURL('src/post_install.html')}, function(tab){ | ||
}); | ||
} | ||
|
||
function onUpdate(){ | ||
console.log("Extension Updated"); | ||
chrome.tabs.create({'url': chrome.extension.getURL('src/post_update.html')}, function(tab){ | ||
}); | ||
} | ||
|
||
chrome.runtime.onInstalled.addListener(function(details){ | ||
var current_version = getVersion(); | ||
var old_version = localStorage['version'] | ||
if (current_version != old_version) { | ||
console.log(old_version); | ||
if (old_version == undefined) { | ||
console.log("OnInstall Call"); | ||
localStorage['version'] = current_version; | ||
onInstall(); | ||
} else { | ||
localStorage['version'] = current_version; | ||
onUpdate(); | ||
} | ||
} | ||
console.log("Reason: " + details.reason); | ||
}); | ||
/** | ||
* chrome_parameters Extension | ||
* | ||
* background.js | ||
* | ||
* @version 1.2 | ||
* | ||
*/ | ||
|
||
var tag; | ||
|
||
/** | ||
* Get the url paramater identified by sParam | ||
* @param {String} sParam The parameter that we want to read from url. | ||
* @return The parameter value if available, null otherwise | ||
*/ | ||
function getURLParameter(sParam) { | ||
var sPageURL = window.location.search.substring(1); | ||
var sURLVariables = sPageURL.split('&'); | ||
for (var i = 0; i < sURLVariables.length; i++) { | ||
var sParameterName = sURLVariables[i].split('='); | ||
if (sParameterName[0] == sParam) { | ||
return sParameterName[1]; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | ||
//var url_url = processUrl(tab.url); | ||
console.log("Parameter: " + tab.url); | ||
var i = 0; | ||
console.log(tab.url.length); | ||
var i = tab.url.indexOf('?'); | ||
var parameter_url = tab.url.substring(i++); | ||
chrome.pageAction.show(tabId); | ||
}); | ||
|
||
function getVersion(){ | ||
var extension_version = chrome.app.getDetails(); | ||
return extension_version.version; | ||
} | ||
|
||
function onInstall(){ | ||
console.log("Extension Installed"); | ||
chrome.tabs.create({'url': chrome.extension.getURL('src/post_install.html')}, function(tab){ | ||
}); | ||
} | ||
|
||
function onUpdate(){ | ||
console.log("Extension Updated"); | ||
chrome.tabs.create({'url': chrome.extension.getURL('src/post_update.html')}, function(tab){ | ||
}); | ||
} | ||
|
||
chrome.runtime.onInstalled.addListener(function(details){ | ||
var current_version = getVersion(); | ||
var old_version = localStorage['version'] | ||
if (current_version != old_version) { | ||
console.log(old_version); | ||
if (old_version == undefined) { | ||
console.log("OnInstall Call"); | ||
localStorage['version'] = current_version; | ||
onInstall(); | ||
} else { | ||
localStorage['version'] = current_version; | ||
onUpdate(); | ||
} | ||
} | ||
console.log("Reason: " + details.reason); | ||
}); | ||
|
||
chrome.webRequest.onBeforeRequest.addListener( | ||
function(details) { | ||
if(details.method == "POST") | ||
console.log(JSON.stringify(details)); | ||
}, | ||
{urls: ["<all_urls>"]}, | ||
["blocking", "requestBody"] | ||
); | ||
|
||
function lastError(){ | ||
if(chrome.runtime.lastError){ | ||
console.log(chrome.runtime.lastError.message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
<html> | ||
<head> | ||
<title>Parameter Editor</title> | ||
<style type="text/css"> | ||
body { | ||
padding: 20; | ||
background-color: #eaeaea; | ||
} | ||
<style type="text/css"> | ||
body { | ||
padding: 20; | ||
background-color: #eaeaea; | ||
} | ||
</style> | ||
</head> | ||
<body > | ||
|
||
<h1><img src="../images/icon.png" height="80" width="80">Thank you for installting Parameter Editor.</h1> | ||
<h2>Scope</h2> | ||
The scope of this extension is to show parameters used to get to the page you're showing, and let you update (if needed) values for those parameter. | ||
<h2>Instructions</h2> | ||
<p> | ||
Just click on EDIT icon you see in the address bar, click and you'll see all parameters used to get to that page.<br/> | ||
You can edit values for those parameters simply typing new value in the text box at the right of parameter key, or if you want you can add new parameters by clicking <b><i>Add new</i></b>.<br/><br /> | ||
|
||
When you've finished editing parameters, just click on <b><i>Update Parameters</i></b> and you'll get to another page with updated parameters. <br /> | ||
<br /> | ||
|
||
If you want to export the parameters list as CSV file just press the <b><i>Export</i></b> button | ||
</p> | ||
<b>Starting from version 1.1</b> you can also import parameters list from comma sperated a CSV file. | ||
<b>Starting from version 1.0</b> you can also export parameters list as CSV file. | ||
<h2>Source code</h2> | ||
This extension is Open Source, released under GPLv3. You can download sources from <a href="http://c103.github.io/chrome_parameters/">GitHub</a> | ||
|
||
<h2>Credits:</h2> | ||
<ul> | ||
<li>Ivan Gualandri (inuyasha82) - Creator and maind developer</li> | ||
<li>Davide Fiorentino - Graphic Content</li> | ||
<li>Jader Dias - Contributor</li> | ||
</ul> | ||
</body> | ||
</html> | ||
</html> |
Oops, something went wrong.