Skip to content

Commit

Permalink
https for external scripts, whitelisted in the manifest.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ao5357 committed Feb 29, 2012
1 parent b3533f2 commit 6e64f65
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion background.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="background.js"></script>
</head><body>
</body></html>
6 changes: 3 additions & 3 deletions background.js
Expand Up @@ -20,12 +20,12 @@ function showNotification(notifStamp){

// query exact and edition ISBNs for CPL holdings
function cplQuery(isbn,notifStamp){
$.getJSON('http://www.cantonpl.org/apis/cat.php?type=i&callback=?',{q: isbn},function(data){
$.getJSON('https://www.cantonpl.org/apis/cat.php?type=i&callback=?',{q: isbn},function(data){
window.notificationData[notifStamp] = resultFormatter(data["0"]);
showNotification(notifStamp);
})
.error(function(){
$.getJSON('http://www.cantonpl.org/apis/frbr.php?callback=?',{i: isbn,results: 1},function(data){
$.getJSON('https://www.cantonpl.org/apis/frbr.php?callback=?',{i: isbn,results: 1},function(data){
window.notificationData[notifStamp] = resultFormatter(data["0"]);
showNotification(notifStamp);
});
Expand Down Expand Up @@ -63,7 +63,7 @@ chrome.omnibox.onInputChanged.addListener(function(text,suggest){
t = setTimeout(function(){
if(text.length >= 4){
var results = new Array();
$.getJSON('http://www.cantonpl.org/apis/cat.php?type=t&callback=?',{q: text},function(data){
$.getJSON('https://www.cantonpl.org/apis/cat.php?type=t&callback=?',{q: text},function(data){
delete data.type;
$.each(data,function(i,item){
var title = $("<div/>").text(item.title).html(), openBrace = title.indexOf('['), slash = title.indexOf('/');
Expand Down
1 change: 1 addition & 0 deletions manifest.json
Expand Up @@ -18,6 +18,7 @@
"js": ["content-script.js"],
"exclude_globs": ["*cantonpl*"]
}],
"content_security_policy": "script-src 'self' https://ajax.googleapis.com https://www.cantonpl.org; object-src 'self'",
"homepage_url": "http://www.cantonpl.org/tools",
"omnibox": {"keyword" : "__MSG_searchKeyword__"},
"permissions": ["notifications","tabs"]
Expand Down
2 changes: 1 addition & 1 deletion notification.html
Expand Up @@ -11,7 +11,7 @@
a span.author{color:#aaa;}
a .title{display:block;text-decoration:underline;}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="notification.js"></script>
</head><body>
<img src="loading.gif" class="icon" alt="" /> Loading message...
Expand Down

0 comments on commit 6e64f65

Please sign in to comment.