diff --git a/manifest.json b/manifest.json index 18c4e33..2f6599f 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "Edziennik-plus", "description": "Więcej funkcji w dzienniku elektronicznym", - "version": "0.3.3", + "version": "0.3.4", "icons": {"128":"icon.png"}, "author": "MS", "options_ui": { @@ -45,12 +45,17 @@ "permissions": [ "storage", "tabs", + "webRequest", + "webRequestBlocking", "https://synergia.librus.pl/*" ], + "background": { + "scripts": ["tlo.js"] + }, "applications": { "gecko": { "id": "edziennikplus@msx", - "update_url": "https://github.com/msxmine/edziennik-plus/blob/updates/updates.json" + "update_url": "https://raw.githubusercontent.com/msxmine/edziennik-plus/updates/updates.json" } } } diff --git a/oceny.js b/oceny.js index 00e064a..4f5e9fd 100644 --- a/oceny.js +++ b/oceny.js @@ -62,6 +62,7 @@ function Ocena(adres) } else { + /* if (adres.parentElement.parentElement.nodeName == "SPAN") { var wagasub = 0; //waga wszystkich zbiorowych @@ -86,8 +87,9 @@ function Ocena(adres) this.waga = (wagasub / iloscistotnych) / iloscistotnych } else{ + */ this.waga = tab[tab.indexOf("Waga")+1]; - } + //} } } } diff --git a/tlo.js b/tlo.js new file mode 100644 index 0000000..ab37fac --- /dev/null +++ b/tlo.js @@ -0,0 +1,15 @@ + +function zmienNaglowek(req) { + var mojNaglowek = { + name: "X-Frame-Options", + value: "SAMEORIGIN" + }; + req.responseHeaders.push(mojNaglowek); + return {responseHeaders: req.responseHeaders}; +} + +browser.webRequest.onHeadersReceived.addListener( + zmienNaglowek, + {urls: ["https://synergia.librus.pl/przegladaj_plan_lekcji"]}, + ["blocking", "responseHeaders"] +);