From 6e4d331260e725a8d8706446252622ca0371303f Mon Sep 17 00:00:00 2001 From: msxmine Date: Fri, 15 Dec 2017 12:33:45 +0100 Subject: [PATCH] 0.3.4 Poprawione srednie popraw, obejscie x-frame-options --- manifest.json | 9 +++++++-- oceny.js | 4 +++- tlo.js | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tlo.js 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"] +);