Commit 4fb98e66 authored by peachaku's avatar peachaku
Browse files

alarm

parent 6b45fe59
......@@ -233,20 +233,3 @@ browser.tabs.onActivated.addListener(function(activeInfo) {
});
});
});
/**
* function if user has clicked on "connexion" menu entry
* The user is redirected to the the appropriate page,
* usually one where they can log in to gain access
*/
//browser.notifications.onButtonClicked.addListener(function(ntId, btnIdx) {
// if (ntId == myNotificationID && btnIdx === 0) {//
// //go to current tab, find that url and redirect
// getCurrentTabUrl(function(url) {
// var redirectUrl = getRedirectUrl(url);//
// browser.tabs.update({ url: redirectUrl });
// });
// }
//});
\ No newline at end of file
......@@ -7,21 +7,33 @@ if (typeof chrome !== "undefined" && chrome) {
browser.runtime.onInstalled.addListener(function() {
validateCacheEzProxy();
chrome.alarms.create("refreshProxyList", {
"periodInMinutes": 10,
"delayInMinutes": 2
});
});
browser.runtime.onStartup.addListener(function() {
validateCacheEzProxy();
chrome.alarms.create("refreshProxyList", {
"periodInMinutes": 10,
"delayInMinutes": 2
});
});
chrome.alarms.onAlarm.addListener(function() {
validateCacheEzProxy();
});
function validateCacheEzProxy() {
var oReq = new XMLHttpRequest();
oReq.onload = function(e) {
// Alert on URL update (delete on prod)
// Alert on URL update
console.log("refresh urlsToProxy");
// We get the json for this extension, we can save it as storage
urlsToProxy = JSON.parse(oReq.response);
};
// Get URL list ezproxy/pages/public/urls.json
oReq.open("get", "http://lama.univ-amu.fr/public/urls.json", true);
oReq.open("get", "https://lama.univ-amu.fr/public/urls.json", true);
oReq.send();
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
"name" : "lama",
"short_name" : "lama",
"description" : "Accès en 1 clic aux ressources des bibliothèques de l'Université d'Aix-Marseille.",
"version" : "0.5",
"version" : "0.7",
"icons": {
"16": "img/1x.png",
"32": "img/1x.png",
......@@ -23,6 +23,7 @@
"chrome_style": true
},
"permissions": [
"alarms",
"webNavigation",
"notifications",
"tabs",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment