forked from ahmadnassri/app-restconsole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the Launcher as an extension
- Loading branch information
Ahmad Nassri
committed
Sep 29, 2011
1 parent
e61d54f
commit faf1e25
Showing
13 changed files
with
169 additions
and
99 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
REST Console is an HTTP Request Visualizer and Constructor tool, helps developers build, debug and test RESTful APIs. | ||
|
||
# Permissions Breakdown: | ||
|
||
* Your tabs and browsing activity: The only access to tabs we need is for launching the oAuth Authorization page to the 3rd party oAuth provider. | ||
|
||
* Your data on all websites: This is somewhat misleading, we ask for `*://*/*` access so that developers can make API calls to ANY URL ... | ||
|
||
we don't collect any personal data and we don't want access to your data on all websites, we simply have to use that permission so developers can use the App on all urls. | ||
|
||
|
||
# Features: | ||
* Syntax highlighting (multiple themes) | ||
* Custom headers | ||
* Construct POST or PUT body via raw input | ||
* Auto Complete | ||
* File upload | ||
* Easy query parameters creation | ||
* Add custom headers through intuitive ui | ||
* Authentication support: Plain, Basic, OAuth + Custom | ||
* Keyboard navigation and shortcuts | ||
* Customizable Interface | ||
|
||
# Resources | ||
|
||
* Follow us on Twitter: http://twitter.com/restconsole | ||
* Get the source code: https://github.com/codeinchaos/rest-console | ||
* Report issues: https://github.com/codeinchaos/rest-console/issues | ||
* Donate: https://flattr.com/thing/156628/REST-Console | ||
|
||
# Changelog | ||
|
||
* v4.0.1 Corrupted images in the previous build now fixed. | ||
* v4.0.0 Brand New UI | ||
* v3.0.7 Updating links to new github project page | ||
* v3.0.6 UI enhancements + File uploads + "Save Default" Option | ||
* v3.0.5 More keyboard shortcuts | ||
* v3.0.4 Bugfixes | ||
* v3.0.3 Keyboard navigation + Bugfixes | ||
* v3.0.2 Syntax Highlighting themes + Collapsible sections + Options | ||
* v3.0.1 RAW request body + Bugfixes | ||
* v3.0.0 Brand New UI | ||
* v2.1.1 Bugfixes | ||
* v2.1 Added OAuth1.0a support + bug fixes. | ||
* v2.0 Revamped Design. | ||
* v1.0 Released! | ||
|
||
# Coming Soon: | ||
|
||
* Request history manager | ||
* URL auto complete |
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,56 +1,8 @@ | ||
<html> | ||
<body> | ||
<script type="text/javascript" src="js/OAuthSimple.js"></script> | ||
<script type="text/javascript" src="js/chrome_ex_oauth.js"></script> | ||
<script type="text/javascript" src="js/analytics.js"></script> | ||
<script> | ||
chrome.browserAction.onClicked.addListener(function (tab) { | ||
chrome.tabs.create({url: 'index.html'}); | ||
}); | ||
|
||
var oAuth = { | ||
'instance': null, | ||
|
||
'hasInstance': function() { | ||
return this.instance ? true : false; | ||
}, | ||
|
||
'initialize': function(options) { | ||
this.instance = ChromeExOAuth.initBackgroundPage(options); | ||
}, | ||
|
||
'hasToken': function() { | ||
return this.instance.hasToken(); | ||
}, | ||
|
||
'authorize': function() { | ||
if (this.hasInstance()) { | ||
this.instance.authorize(function() { | ||
chrome.extension.getViews().forEach(function(view) { | ||
dialog = view.document.querySelector('form.authorization.oauth'); | ||
|
||
if (dialog) { | ||
var token_key = dialog.querySelector('input[name="token_key"]'); | ||
var token_secret = dialog.querySelector('input[name="token_secret"]'); | ||
|
||
token_key.value = oAuth.instance.getToken(); | ||
token_key.fireEvent('change'); | ||
|
||
token_secret.value = oAuth.instance.getTokenSecret(); | ||
token_secret.fireEvent('change'); | ||
} | ||
}); | ||
}); | ||
} | ||
}, | ||
|
||
'clear': function() { | ||
if (this.hasInstance()) { | ||
this.instance.clearTokens(); | ||
this.instance = null; | ||
} | ||
} | ||
} | ||
</script> | ||
<script src="js/OAuthSimple.js"></script> | ||
<script src="js/chrome_ex_oauth.js"></script> | ||
<script src="js/analytics.js"></script> | ||
<script src="js/background.js"></script> | ||
</body> | ||
</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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var oAuth = { | ||
'instance': null, | ||
|
||
'hasInstance': function() { | ||
return this.instance ? true : false; | ||
}, | ||
|
||
'initialize': function(options) { | ||
this.instance = ChromeExOAuth.initBackgroundPage(options); | ||
}, | ||
|
||
'hasToken': function() { | ||
return this.instance.hasToken(); | ||
}, | ||
|
||
'authorize': function() { | ||
if (this.hasInstance()) { | ||
this.instance.authorize(function() { | ||
chrome.extension.getViews().forEach(function(view) { | ||
dialog = view.document.querySelector('form.authorization.oauth'); | ||
|
||
if (dialog) { | ||
var token_key = dialog.querySelector('input[name="token_key"]'); | ||
var token_secret = dialog.querySelector('input[name="token_secret"]'); | ||
|
||
token_key.value = oAuth.instance.getToken(); | ||
token_key.fireEvent('change'); | ||
|
||
token_secret.value = oAuth.instance.getTokenSecret(); | ||
token_secret.fireEvent('change'); | ||
} | ||
}); | ||
}); | ||
} | ||
}, | ||
|
||
'clear': function() { | ||
if (this.hasInstance()) { | ||
this.instance.clearTokens(); | ||
this.instance = null; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<html> | ||
<body> | ||
<script> | ||
const ID = 'cokgbflfommojglbmbpenpphppikmonn'; | ||
const URL = 'https://chrome.google.com/webstore/detail/' + ID; | ||
|
||
// add click event listenr | ||
chrome.browserAction.onClicked.addListener(function(tab) { | ||
// get all apps | ||
chrome.management.getAll(function(apps) { | ||
// loop through apps | ||
for (var i in apps) { | ||
var app = apps[i]; | ||
|
||
// found it! | ||
if (app.id == ID) { | ||
console.log(app) | ||
if (app.enabled) { | ||
// is it enabled? | ||
//launch it | ||
chrome.management.launchApp(app.id); | ||
} else { | ||
// enable it | ||
chrome.management.setEnabled(app.id, true, function() { | ||
// then launch it | ||
chrome.management.launchApp(app.id); | ||
}); | ||
} | ||
|
||
// we are done here | ||
return; | ||
} | ||
} | ||
|
||
// fail! go to store! | ||
chrome.tabs.create({'url': URL}); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": "4.0.1.1", | ||
|
||
"name": "REST Console Launcher", | ||
"description": "This is a toolbar launcher for REST Console. get the REST Console App at http://www.restconsole.com", | ||
|
||
"background_page": "background.html", | ||
|
||
"icons": { | ||
"16": "images/logo/16.png", | ||
"32": "images/logo/32.png", | ||
"48": "images/logo/48.png", | ||
"128": "images/logo/128.png" | ||
}, | ||
|
||
"browser_action": { | ||
"default_icon": "images/logo/32.png" | ||
}, | ||
|
||
"permissions": [ | ||
"tabs", | ||
"management" | ||
] | ||
} |