From 445303ea9072834585cdecc8bf3c8f2fce51f7c6 Mon Sep 17 00:00:00 2001 From: Pierre GOUTAGNY Date: Thu, 10 Aug 2023 18:02:34 +0200 Subject: [PATCH 01/22] Ajoute le support ENS de Lyon (#30) --- ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index a434e3f..e95620f 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -63,6 +63,13 @@ const ophirofox_config_list = [ AUTH_URL: "https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1", }, + { + name: "ENS de Lyon", + domains: ["ens-lyon.fr"], + LOGIN_URL: "https://acces.bibliotheque-diderot.fr/login", + AUTH_URL: + "https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1", + }, { name: "Pas d'intermédiaire", domains: ["europresse.com"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 8d18111..5e736f7 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -134,7 +134,8 @@ "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Search/Reading*", "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Search/Reading*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/Reading*", - "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/Reading*" + "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/Reading*", + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*" ], "js": [ "content_scripts/europresse_search.js" @@ -151,7 +152,8 @@ "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Login*", "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Login*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Login*", - "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Login*" + "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Login*", + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*" ], "js": [ "content_scripts/config.js", @@ -169,7 +171,8 @@ "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Search/ResultMobile*", "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Search/ResultMobile*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/ResultMobile*" + "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*" ], "css": [ "content_scripts/europresse_article.css" From 7ed62b2814f80573face26f0830d41e98b86d61d Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Thu, 10 Aug 2023 22:19:40 +0200 Subject: [PATCH 02/22] ajout ens lyon au readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index aa1d142..9c25108 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ d'être redirigé automatiquement vers une page de recherche europresse qui cont L'extension fonctionne avec les portails universitaires suivants : - [**Europresse ENS Ulm PSL**](http://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1), + - [**Europresse ENS Lyon**](https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1), - [**Europresse ENSAM (Arts et Métiers)**](http://rp1.ensam.eu/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=AML), - [**Europresse Université Paris-Saclay**](https://proxy.scd.u-psud.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9), - [**Europresse INSA Lyon**](https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3) From a2f78605b0bc01150d468d621d99dc412725d07d Mon Sep 17 00:00:00 2001 From: Thibault Date: Thu, 10 Aug 2023 23:23:29 +0200 Subject: [PATCH 03/22] =?UTF-8?q?Ajoute=20le=20support=20de=20l'Universit?= =?UTF-8?q?=C3=A9=20de=20Haute-Alsace=20(#31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c25108..de276d3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Université de Bordeaux**](https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1) - [**Europresse Université de Montpellier**](https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1) - [**Europresse Université de Grenoble**](https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1) + - [**Europresse Université de Haute-Alsace**](https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1) Ou directement via le site Europresse. diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index e95620f..2a927be 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -70,6 +70,13 @@ const ophirofox_config_list = [ AUTH_URL: "https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1", }, + { + name: "Université de Haute-Alsace", + domains: ["uha.fr"], + LOGIN_URL: "https://scd-proxy.uha.fr/login", + AUTH_URL: + "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1", + }, { name: "Pas d'intermédiaire", domains: ["europresse.com"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 5e736f7..be463b2 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -135,7 +135,8 @@ "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Search/Reading*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/Reading*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/Reading*", - "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*" + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*", + "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*" ], "js": [ "content_scripts/europresse_search.js" @@ -153,7 +154,8 @@ "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Login*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Login*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Login*", - "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*" + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*", + "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*" ], "js": [ "content_scripts/config.js", @@ -172,7 +174,8 @@ "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Search/ResultMobile*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/ResultMobile*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*" + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*" ], "css": [ "content_scripts/europresse_article.css" From ede7d8921be944445e48752d6c4acd8d16c3edcd Mon Sep 17 00:00:00 2001 From: Robin Cura Date: Thu, 10 Aug 2023 23:55:04 +0200 Subject: [PATCH 04/22] =?UTF-8?q?Ajout=20du=20support=20de=20l'Universit?= =?UTF-8?q?=C3=A9=20Paris=201=20Panth=C3=A9on-Sorbonne=20(#32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding support Paris 1 Panthéon-Sorbonne * Paris1 : oubli du https * idem... --- README.md | 1 + ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 3 +++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index de276d3..0d22c55 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse ENS Lyon**](https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1), - [**Europresse ENSAM (Arts et Métiers)**](http://rp1.ensam.eu/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=AML), - [**Europresse Université Paris-Saclay**](https://proxy.scd.u-psud.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9), + - [**Europresse Université Paris 1 Panthéon-Sorbonne**](http://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1), - [**Europresse INSA Lyon**](https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3) - [**Europresse Bibliothèque nationale de France**](https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnf) - [**Europresse Université de Bordeaux Montaigne**](https://www.ezproxy.u-bordeaux-montaigne.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVMONTAIGNET_1) diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index 2a927be..897ee44 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -21,6 +21,13 @@ const ophirofox_config_list = [ AUTH_URL: "https://proxy.scd.u-psud.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9", }, + { + name: "Université Paris 1 Panthéon-Sorbonne", + domains: ["univ-paris1.fr"], + LOGIN_URL: "https://ezpaarse.univ-paris1.fr/login", + AUTH_URL: + "https://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1", + }, { name: "INSA Lyon", domains: ["insa-lyon.fr"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index be463b2..a3938ad 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -129,6 +129,7 @@ "https://nouveau-europresse-com.proxy.rubens.ens.fr/Search/Reading*", "https://nouveau-europresse-com.rp1.ensam.eu/Search/Reading*", "https://nouveau-europresse-com.proxy.scd.u-psud.fr/Search/Reading*", + "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Search/Reading*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/Search/Reading*", "https://nouveau-europresse-com.bnf.idm.oclc.org/Search/Reading*", "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Search/Reading*", @@ -148,6 +149,7 @@ "https://nouveau-europresse-com.proxy.rubens.ens.fr/Login*", "https://nouveau-europresse-com.rp1.ensam.eu/Login*", "https://nouveau-europresse-com.proxy.scd.u-psud.fr/Login*", + "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Login*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/Login*", "https://nouveau-europresse-com.bnf.idm.oclc.org/Login*", "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Login*", @@ -168,6 +170,7 @@ "https://nouveau-europresse-com.proxy.rubens.ens.fr/Search/ResultMobile*", "https://nouveau-europresse-com.rp1.ensam.eu/Search/ResultMobile*", "https://nouveau-europresse-com.proxy.scd.u-psud.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Search/ResultMobile*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/Search/ResultMobile*", "https://nouveau-europresse-com.bnf.idm.oclc.org/Search/ResultMobile*", "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Search/ResultMobile*", From eddeb50efd85da6cb1e1379239f4cadca2634752 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 11:01:44 +0200 Subject: [PATCH 05/22] Update CI --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d95eb56..9881e97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,10 +13,10 @@ jobs: name: Build and publish the extension runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '20' - run: npm install --global web-ext - id: version run: echo version=$(jq -r ".version + \".$(($(date +%s)/100000)).$(($(date +%s)%65535))\"" < manifest.json) >> $GITHUB_OUTPUT From 7609f94840c34fd89fc1012d9918efacbee7a8ab Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 11:15:02 +0200 Subject: [PATCH 06/22] remove deprecated release creation action --- .github/workflows/main.yml | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9881e97..b0ca085 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,32 +32,16 @@ jobs: - run: ls -lah ./web-ext-artifacts - id: filename run: echo filename=$(echo $PWD/web-ext-artifacts/*xpi) >> $GITHUB_OUTPUT + - run: ../update-manifest.py | tee /tmp/update_manifest.json - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: v${{ steps.version.outputs.version }} - release_name: Release ${{ steps.version.outputs.version }} + name: Release ${{ steps.version.outputs.version }} draft: false prerelease: false - - name: Upload the xpi file as a release asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.filename.outputs.filename }} - asset_name: ophirofox.xpi - asset_content_type: application/zip - - run: ../update-manifest.py | tee /tmp/update_manifest.json - - name: Upload the extension's update manifest - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: /tmp/update_manifest.json - asset_name: update_manifest.json - asset_content_type: application/json + files: | + ${{ steps.filename.outputs.filename }} + /tmp/update_manifest.json + + From 95cea3da209e6dfec1d43d4001ac70e3c79d8f84 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 11:28:09 +0200 Subject: [PATCH 07/22] correction nom fichier --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0ca085..b3ef19b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,8 +30,7 @@ jobs: WEB_EXT_API_KEY: ${{ secrets.AMO_JWT_ISSUER }} WEB_EXT_API_SECRET: ${{ secrets.AMO_JWT_SECRET }} - run: ls -lah ./web-ext-artifacts - - id: filename - run: echo filename=$(echo $PWD/web-ext-artifacts/*xpi) >> $GITHUB_OUTPUT + - run: cp $PWD/web-ext-artifacts/*xpi ophirofox.xpi - run: ../update-manifest.py | tee /tmp/update_manifest.json - name: Create Release uses: softprops/action-gh-release@v1 @@ -41,7 +40,7 @@ jobs: draft: false prerelease: false files: | - ${{ steps.filename.outputs.filename }} + ophirofox.xpi /tmp/update_manifest.json From d63f894134e21fa43c0939a38efd16f1d94292e7 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 11:41:53 +0200 Subject: [PATCH 08/22] =?UTF-8?q?construction=20et=20upload=20automatique?= =?UTF-8?q?=20de=20l'extension=20pour=20pr=C3=A9visualisation=20dans=20les?= =?UTF-8?q?=20pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr.yaml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8d99153..aafa02c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,4 +1,4 @@ -name: Sign webextension +name: "Construction de l'extension" on: [pull_request] defaults: @@ -10,10 +10,25 @@ jobs: name: web-ext lint and build runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '20' - run: npm install --global web-ext - run: web-ext lint --self-hosted --warnings-as-errors - - run: web-ext build \ No newline at end of file + - run: web-ext build + - run: cp web-ext-artifacts/*xpi ophirofox.xpi + - uses: actions/upload-artifact@v3 + id: upload + with: + name: ophirofox.xpi + path: ophirofox.xpi + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Voilà l'extension à télécharger pour tester: https://github.com/lovasoa/ophirofox/pull/${{ github.event.pull_request.number }}/checks + Cliquez sur "Construction de l'extension" puis sur `ophirofox.xpi` + From dca8f531b25ea45fb10b4db54e94cfcb856ac6de Mon Sep 17 00:00:00 2001 From: lovasoa Date: Fri, 11 Aug 2023 11:45:19 +0200 Subject: [PATCH 09/22] fix pr workflow --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index aafa02c..2db9881 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -17,7 +17,7 @@ jobs: - run: npm install --global web-ext - run: web-ext lint --self-hosted --warnings-as-errors - run: web-ext build - - run: cp web-ext-artifacts/*xpi ophirofox.xpi + - run: cp web-ext-artifacts/*zip ophirofox.xpi - uses: actions/upload-artifact@v3 id: upload with: From c3bd99efa37ab3f493e5747b85a54c5ff0fefdf9 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 12:18:20 +0200 Subject: [PATCH 10/22] nouvelle url paris saclay (#36) * nouvelle url paris saclay * Update config.js * Update README.md * Update manifest.json * update runner * update runner * fix path --- .github/workflows/pr.yaml | 10 +++++----- README.md | 2 +- ophirofox/content_scripts/config.js | 4 ++-- ophirofox/manifest.json | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2db9881..ce774f6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -8,7 +8,7 @@ defaults: jobs: check: name: web-ext lint and build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -17,12 +17,12 @@ jobs: - run: npm install --global web-ext - run: web-ext lint --self-hosted --warnings-as-errors - run: web-ext build - - run: cp web-ext-artifacts/*zip ophirofox.xpi - uses: actions/upload-artifact@v3 id: upload with: - name: ophirofox.xpi - path: ophirofox.xpi + name: ophirofox.zip + path: ophirofox/web-ext-artifacts/*.zip + if-no-files-found: error - name: Create or update comment uses: peter-evans/create-or-update-comment@v3 with: @@ -30,5 +30,5 @@ jobs: issue-number: ${{ github.event.pull_request.number }} body: | Voilà l'extension à télécharger pour tester: https://github.com/lovasoa/ophirofox/pull/${{ github.event.pull_request.number }}/checks - Cliquez sur "Construction de l'extension" puis sur `ophirofox.xpi` + Cliquez sur "Construction de l'extension" puis sur `ophirofox.zip` diff --git a/README.md b/README.md index 0d22c55..56dfe33 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse ENS Ulm PSL**](http://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1), - [**Europresse ENS Lyon**](https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1), - [**Europresse ENSAM (Arts et Métiers)**](http://rp1.ensam.eu/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=AML), - - [**Europresse Université Paris-Saclay**](https://proxy.scd.u-psud.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9), + - [**Europresse Université Paris-Saclay**](https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9), - [**Europresse Université Paris 1 Panthéon-Sorbonne**](http://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1), - [**Europresse INSA Lyon**](https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3) - [**Europresse Bibliothèque nationale de France**](https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnf) diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index 897ee44..4353c17 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -17,9 +17,9 @@ const ophirofox_config_list = [ { name: "Université Paris-Saclay", domains: ["universite-paris-saclay.fr"], - LOGIN_URL: "https://proxy.scd.u-psud.fr/login", + LOGIN_URL: "https://ezproxy.universite-paris-saclay.fr/login", AUTH_URL: - "https://proxy.scd.u-psud.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9", + "https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9", }, { name: "Université Paris 1 Panthéon-Sorbonne", diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index a3938ad..6a75f5d 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -128,7 +128,7 @@ "https://nouveau.europresse.com/Search/Reading*", "https://nouveau-europresse-com.proxy.rubens.ens.fr/Search/Reading*", "https://nouveau-europresse-com.rp1.ensam.eu/Search/Reading*", - "https://nouveau-europresse-com.proxy.scd.u-psud.fr/Search/Reading*", + "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/Search/Reading*", "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Search/Reading*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/Search/Reading*", "https://nouveau-europresse-com.bnf.idm.oclc.org/Search/Reading*", @@ -148,7 +148,7 @@ "https://nouveau.europresse.com/Login*", "https://nouveau-europresse-com.proxy.rubens.ens.fr/Login*", "https://nouveau-europresse-com.rp1.ensam.eu/Login*", - "https://nouveau-europresse-com.proxy.scd.u-psud.fr/Login*", + "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/Login*", "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Login*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/Login*", "https://nouveau-europresse-com.bnf.idm.oclc.org/Login*", @@ -169,7 +169,7 @@ "https://nouveau.europresse.com/Search/ResultMobile*", "https://nouveau-europresse-com.proxy.rubens.ens.fr/Search/ResultMobile*", "https://nouveau-europresse-com.rp1.ensam.eu/Search/ResultMobile*", - "https://nouveau-europresse-com.proxy.scd.u-psud.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/Search/ResultMobile*", "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Search/ResultMobile*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/Search/ResultMobile*", "https://nouveau-europresse-com.bnf.idm.oclc.org/Search/ResultMobile*", From a400b0e72e67439960d8ac0cc65fca0b5c97a98f Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 13:12:40 +0200 Subject: [PATCH 11/22] correction upload release --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3ef19b..b4bb433 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: WEB_EXT_API_KEY: ${{ secrets.AMO_JWT_ISSUER }} WEB_EXT_API_SECRET: ${{ secrets.AMO_JWT_SECRET }} - run: ls -lah ./web-ext-artifacts - - run: cp $PWD/web-ext-artifacts/*xpi ophirofox.xpi + - run: cp $PWD/web-ext-artifacts/*xpi ../ophirofox.xpi - run: ../update-manifest.py | tee /tmp/update_manifest.json - name: Create Release uses: softprops/action-gh-release@v1 From aedd2c2ae278a9e21ec8cce14319624f31445c31 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Fri, 11 Aug 2023 13:33:30 +0200 Subject: [PATCH 12/22] correction bot pr --- .github/workflows/pr.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ce774f6..5954a52 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,6 +7,8 @@ defaults: jobs: check: + permissions: + pull-requests: write name: web-ext lint and build runs-on: ubuntu-22.04 steps: From d50c970b1ff00d9f19b3d6e98a1f8ce8a16d2fff Mon Sep 17 00:00:00 2001 From: Thibault Date: Fri, 11 Aug 2023 14:39:51 +0200 Subject: [PATCH 13/22] =?UTF-8?q?Ajoute=20le=20support=20de=20l'Universit?= =?UTF-8?q?=C3=A9=20de=20Franche-Comt=C3=A9=20(#38)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ajoute le support de l'Université de Haute-Alsace * Ajout de l'UHA dans le readme * Ajoute le support de l'Université de Franche-Comté --- README.md | 1 + ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 56dfe33..a53bd5f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Université de Montpellier**](https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1) - [**Europresse Université de Grenoble**](https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1) - [**Europresse Université de Haute-Alsace**](https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1) + - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) Ou directement via le site Europresse. diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index 4353c17..e822d1b 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -84,6 +84,13 @@ const ophirofox_config_list = [ AUTH_URL: "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1", }, + { + name: "Université de Franche-Comté", + domains: ["univ-fcomte.fr"], + LOGIN_URL: "http://scd1.univ-fcomte.fr/login", + AUTH_URL: + "http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1", + }, { name: "Pas d'intermédiaire", domains: ["europresse.com"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 6a75f5d..6f911b9 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -137,7 +137,8 @@ "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/Reading*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/Reading*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*", - "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*" + "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*", + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/Reading*" ], "js": [ "content_scripts/europresse_search.js" @@ -157,7 +158,8 @@ "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Login*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Login*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*", - "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*" + "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*", + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Login*" ], "js": [ "content_scripts/config.js", @@ -178,7 +180,8 @@ "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/ResultMobile*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/ResultMobile*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*" + "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/ResultMobile*" ], "css": [ "content_scripts/europresse_article.css" From 87942f7926cdc1d6e76d64283df428b5091d1e6a Mon Sep 17 00:00:00 2001 From: Camille Signoretto <74491068+Camille-Sisi@users.noreply.github.com> Date: Fri, 11 Aug 2023 14:43:50 +0200 Subject: [PATCH 14/22] =?UTF-8?q?Ajout=20Universit=C3=A9=20Paris=20Cit?= =?UTF-8?q?=C3=A9=20(#37)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update README.md * Update manifest.json * Update config.js * suppression des commentaires auto --------- Co-authored-by: lovasoa --- .github/workflows/pr.yaml | 12 +----------- README.md | 1 + ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 3 +++ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5954a52..a11fcde 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,8 +7,6 @@ defaults: jobs: check: - permissions: - pull-requests: write name: web-ext lint and build runs-on: ubuntu-22.04 steps: @@ -25,12 +23,4 @@ jobs: name: ophirofox.zip path: ophirofox/web-ext-artifacts/*.zip if-no-files-found: error - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - Voilà l'extension à télécharger pour tester: https://github.com/lovasoa/ophirofox/pull/${{ github.event.pull_request.number }}/checks - Cliquez sur "Construction de l'extension" puis sur `ophirofox.zip` - + diff --git a/README.md b/README.md index a53bd5f..d85b189 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Université de Montpellier**](https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1) - [**Europresse Université de Grenoble**](https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1) - [**Europresse Université de Haute-Alsace**](https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1) + - [**Europresse Université Paris Cité**](https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS) - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) Ou directement via le site Europresse. diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index e822d1b..9963398 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -84,6 +84,13 @@ const ophirofox_config_list = [ AUTH_URL: "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1", }, + { + name: "Université Paris Cité", + domains:["u-paris.fr"], + LOGIN_URL: "https://ezproxy.u-paris.fr/login", + AUTH_URL: + "https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS", + }, { name: "Université de Franche-Comté", domains: ["univ-fcomte.fr"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 6f911b9..2275f40 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -138,6 +138,7 @@ "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/Reading*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*", "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*", + "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/Reading*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/Reading*" ], "js": [ @@ -159,6 +160,7 @@ "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Login*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*", "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*", + "https://nouveau-europresse-com.ezproxy.u-paris.fr/Login*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Login*" ], "js": [ @@ -181,6 +183,7 @@ "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/ResultMobile*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*", "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/ResultMobile*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/ResultMobile*" ], "css": [ From a24c20525748ed1603414236be181778d6022354 Mon Sep 17 00:00:00 2001 From: lgrardin <47626523+chewewewe@users.noreply.github.com> Date: Fri, 11 Aug 2023 18:14:51 +0200 Subject: [PATCH 15/22] =?UTF-8?q?ajout=20de=20l'universit=C3=A9=20de=20pau?= =?UTF-8?q?=20=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update README.md ajout de l'université de pau * Update README.md * Update config.js * Update manifest.json * Update manifest.json * Update ophirofox/content_scripts/config.js * Update ophirofox/content_scripts/config.js --------- Co-authored-by: Ophir LOJKINE --- README.md | 3 ++- ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 9 ++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d85b189..0b55e1a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Université de Haute-Alsace**](https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1) - [**Europresse Université Paris Cité**](https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS) - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) - + - [**Europresse Université de Pau et des pays de l'Adour**](https://nouveau-europresse-com.rproxy.univ-pau.fr/access/ip/default.aspx?un=uppaT_2) + Ou directement via le site Europresse. ## Sites supportés diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index 9963398..ce14f27 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -98,6 +98,13 @@ const ophirofox_config_list = [ AUTH_URL: "http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1", }, + { + name: "Université de Pau et des Pays de l'Adour", + domains: ["univ-pau.fr"], + LOGIN_URL: "https://rproxy.univ-pau.fr/login", + AUTH_URL: + "https://rproxy.univ-pau.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=uppaT_2", + }, { name: "Pas d'intermédiaire", domains: ["europresse.com"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 2275f40..abf2979 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -139,7 +139,8 @@ "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*", "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/Reading*", - "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/Reading*" + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/Reading*", + "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*" ], "js": [ "content_scripts/europresse_search.js" @@ -161,7 +162,8 @@ "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*", "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/Login*", - "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Login*" + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Login*", + "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*" ], "js": [ "content_scripts/config.js", @@ -184,7 +186,8 @@ "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*", "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/ResultMobile*" + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.rproxy.univ-pau.fr/Search/ResultMobile*" ], "css": [ "content_scripts/europresse_article.css" From 9e4a07eaed71971c1a757e722bd67b30ed003e8e Mon Sep 17 00:00:00 2001 From: fmoncomble <59739627+fmoncomble@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:08:21 +0200 Subject: [PATCH 16/22] =?UTF-8?q?Ajout=20Universit=C3=A9=20d'Artois?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ajout Université d'Artois dans README.md * Ajout Université d'Artois dans config.js * Ajout Université d'Artois à manifest.json --------- Co-authored-by: lovasoa --- README.md | 1 + ophirofox/content_scripts/config.js | 7 +++++++ ophirofox/manifest.json | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b55e1a..e830676 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Université Paris Cité**](https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS) - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) - [**Europresse Université de Pau et des pays de l'Adour**](https://nouveau-europresse-com.rproxy.univ-pau.fr/access/ip/default.aspx?un=uppaT_2) + - [**Europresse Université d'Artois**] (http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1) Ou directement via le site Europresse. diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index ce14f27..4c6cd6e 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -105,6 +105,13 @@ const ophirofox_config_list = [ AUTH_URL: "https://rproxy.univ-pau.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=uppaT_2", }, + { + name: "Université d'Artois", + domains: ["univ-arrtois.fr"], + LOGIN_URL: "http://ezproxy.univ-artois.fr/login", + AUTH_URL: + "http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1", + }, { name: "Pas d'intermédiaire", domains: ["europresse.com"], diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index abf2979..2f2770a 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -140,7 +140,8 @@ "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/Reading*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/Reading*", - "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*" + "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*", + "https://nouveau-europresse-com.ezproxy.univ-artois.fr/Search/Reading*" ], "js": [ "content_scripts/europresse_search.js" @@ -163,7 +164,8 @@ "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/Login*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Login*", - "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*" + "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*", + "https://nouveau-europresse-com.ezproxy.univ-artois.fr/Login*" ], "js": [ "content_scripts/config.js", @@ -187,7 +189,8 @@ "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/ResultMobile*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.rproxy.univ-pau.fr/Search/ResultMobile*" + "https://nouveau-europresse-com.rproxy.univ-pau.fr/Search/ResultMobile*", + "https://nouveau-europresse-com.ezproxy.univ-artois.fr/Search/ResultMobile*" ], "css": [ "content_scripts/europresse_article.css" From b195ce65369ada3fd42a07175cac4b95be89cfd8 Mon Sep 17 00:00:00 2001 From: lovasoa Date: Mon, 14 Aug 2023 15:36:56 +0200 Subject: [PATCH 17/22] add github token to action --- .github/workflows/main.yml | 2 ++ update-manifest.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4bb433..6618be8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,6 +32,8 @@ jobs: - run: ls -lah ./web-ext-artifacts - run: cp $PWD/web-ext-artifacts/*xpi ../ophirofox.xpi - run: ../update-manifest.py | tee /tmp/update_manifest.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release uses: softprops/action-gh-release@v1 with: diff --git a/update-manifest.py b/update-manifest.py index f871d1e..9a59365 100755 --- a/update-manifest.py +++ b/update-manifest.py @@ -2,6 +2,7 @@ import json import sys +import os import urllib.request from pathlib import Path @@ -14,8 +15,11 @@ def get_extension_manifest(): def get_github_releases(): - url = "https://api.github.com/repos/lovasoa/ophirofox/releases" - return json.load(urllib.request.urlopen(url)) + token = os.environ.get("GITHUB_TOKEN") + return json.load(urllib.request.urlopen(urllib.request.Request( + url="https://api.github.com/repos/lovasoa/ophirofox/releases", + headers={"authorization": "Bearer " + token} if token else {}, + ))) def version_details(release): From bf8fada85334822084728160af67ddf8b562b3b2 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Tue, 15 Aug 2023 22:12:46 +0200 Subject: [PATCH 18/22] =?UTF-8?q?v2=20:=20plus=20rapide,=20consomme=20moin?= =?UTF-8?q?s=20de=20resources,=20nouveaux=20sites=20de=20presse=20et=20uni?= =?UTF-8?q?versit=C3=A9s,=20ajout=20d'universit=C3=A9=20plus=20facile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * switc to manifest v3 and improve options UI * Update manifest.json (#48) login* était à la place Search/Reading*. * Ajout prise en charge Le Soir (Belgique) & Financial Times (#47) * Update README.md * Create lesoir.js * Update manifest.json * Create lesoir.css * Update manifest.json * Update README.md * Create ft.js * Update manifest.json * Create ft.css * Update ft.js * Update ft.js * Delete ft.css * Delete ft.js * Update manifest.json * Create ft.js * Update manifest.json * Delete ft.js * Update manifest.json * Create ft.js * Update manifest.json * Update ft.js * Update ft.js * Update ft.js * Update ft.js * Update ft.js * Update README.md * retour au manifest v2 * config est maintenant un module js * suppression module * simplification du système d'urls et de lien Il est maintenant plus facile d'ajouter une nouvelle université, et plus facile d'ajouter un nouveau site de presse * BNF par défaut * facilitation de l'ajout d'universités déplacement de la liste des universités vers manifest.json On n'a plus qu'un seul fichier à modifier pour ajouter une univ * suppression de europresse_login qui n'est plus nécessaire * simplification du manifest.json pour éviter la duplication * v2.0 * ajout d'un guide pour l'ajout d'une univ * correction md * suppression financial times --------- Co-authored-by: lgrardin <47626523+lgrardin@users.noreply.github.com> Co-authored-by: fmoncomble <59739627+fmoncomble@users.noreply.github.com> --- README.md | 34 +++- ophirofox/content_scripts/config.js | 171 ++---------------- .../courrier-international.css | 1 - .../content_scripts/courrier-international.js | 15 +- ophirofox/content_scripts/europresse_login.js | 13 -- .../content_scripts/europresse_search.js | 18 +- ophirofox/content_scripts/humanite.js | 16 +- ophirofox/content_scripts/la-montagne.js | 11 +- ophirofox/content_scripts/lacroix.css | 4 + ophirofox/content_scripts/lacroix.js | 20 +- ophirofox/content_scripts/le-point.js | 16 +- ophirofox/content_scripts/lefigaro.js | 11 +- ophirofox/content_scripts/lemonde.js | 14 +- ophirofox/content_scripts/lesoir.css | 3 + ophirofox/content_scripts/lesoir.js | 25 +++ ophirofox/content_scripts/liberation.js | 11 +- ophirofox/content_scripts/monde-diplo.js | 11 +- ophirofox/manifest.json | 165 ++++++++++------- ophirofox/settings/options_ui.html | 44 ++++- ophirofox/settings/options_ui.js | 6 - 20 files changed, 247 insertions(+), 362 deletions(-) delete mode 100644 ophirofox/content_scripts/europresse_login.js create mode 100644 ophirofox/content_scripts/lesoir.css create mode 100644 ophirofox/content_scripts/lesoir.js diff --git a/README.md b/README.md index e830676..3f1add4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Université Paris Cité**](https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS) - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) - [**Europresse Université de Pau et des pays de l'Adour**](https://nouveau-europresse-com.rproxy.univ-pau.fr/access/ip/default.aspx?un=uppaT_2) - - [**Europresse Université d'Artois**] (http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1) + - [**Europresse Université d'Artois**](http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1) Ou directement via le site Europresse. @@ -45,6 +45,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [L'Humanité](https://www.humanite.fr) - [La Montagne](https://www.lamontagne.fr) - [Le Point](https://www.lepoint.fr) + - [Le Soir](https://www.lesoir.be) Vous pouvez proposer d'autres sites en ouvrant une [demande sur github](https://github.com/lovasoa/ophirofox/issues) @@ -67,18 +68,31 @@ ophirofox est [présent sur le Chrome Webstore](https://chrome.google.com/websto image -# Comment cela fonctionne +# Comment ajouter un nouveau partenaires Europresse -L'extension injecte un script dans toutes les pages du monde.fr pour détecter les articles payants. -Lorsqu'un article est détecté, l'extension lui ajoute un lien intitulé *Lire sur Europresse* qui pointe vers -[`http://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/Search/Reading?ophirofox_source=`](http://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/Search/Reading?ophirofox_source=), -suivi de l'adresse de la page du monde originale. +Si votre établissement a un portail Europresse, vous pouvez facilement ajouter son support à cette extension. -Lorsque l'utilisateur se retrouve sur [la page de connexion à europresse](https://nouveau-europresse-com.proxy.rubens.ens.fr/Login/), dont l'utilisateur n'a pas les identifiants, -l'extension modifie la page pour simplement afficher les mots *Authentification*, et charge en arrière plan la page [`https://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1`](https://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1) qui permet de s'identifier sans mot de passe, puis recharge la page. +1. Créez un compte sur [github](https://github.com). +2. Sur github, ouvrez [le fichier `manifest.json` de l'extension](https://github.com/lovasoa/ophirofox/blob/master/ophirofox/manifest.json). +3. Cliquez sur le crayon pour éditer le fichier. +4. Ajoutez votre université à la liste des partenaires Europresse supportés, en suivant le modèle des autres universités. + - Dans la section qui contient toutes les URLs au format `https://nouveau-europresse-com.proxy.universite.fr/Search/Reading*`, ajoutez une ligne avec l'URL du proxy europresse de votre université. + - Dans la section qui contient tous les objets au format + `{ "name": "Université XYZ", "AUTH_URL": "https://rproxy.univ-xyz.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=CODE_UNIVERSITE" }` + , ajoutez un objet avec le nom de votre université et l'URL de son lien de connexion europresse. Vous pouvez trouver l'URL de connexion en vous connectant à votre portail d'université, puis en faisant un clic droit sur le lien de connexion à Europresse et en choisissant *Copier l'adresse du lien*. Conservez l'ordre alphabétique des universités. +5. Cliquez sur *Propose file change*. +6. Indiquez le nom de votre université dans le champ *Propose file change*. +7. Cliquez sur *Create pull request*. -Quand l'utilisateur se retrouve enfin sur la page d'accueil d'Europresse, l'extension utilise la variable `ophirofox_source` définie initialement pour extraire les mots du titre de l'article, -et lancer une recherche europresse. +# Comment cela fonctionne + +1. L'extension injecte un script dans toutes les pages des journaux supportés pour détecter les articles payants. +Lorsqu'un article est détecté, l'extension lui ajoute un lien intitulé *Lire sur Europresse* qui pointe vers +la page de connexion europresse de l'université sélectionnée par l'utilisateur. +Lorsque l'utilisateur clique sur le lien, le titre de l'article est extrait de la page actuelle, +et conservée dans l'espace de stockage local de l'extension pour être réutilisé ensuite. +2. Quand l'utilisateur se retrouve sur la page d'accueil d'Europresse, après s'être connecté, l'extension utilise le titre stocké à l'étape précédente pour lancer une recherche europresse. Le titre est ensuite tout de suite supprimé de l'espace de stockage local. +3. Lorsque l'utilisateur ouvre l'article, l'extension supprime l'horrible surlignage jaune qui est ajouté par défaut par Europresse. # License diff --git a/ophirofox/content_scripts/config.js b/ophirofox/content_scripts/config.js index 4c6cd6e..a063054 100644 --- a/ophirofox/content_scripts/config.js +++ b/ophirofox/content_scripts/config.js @@ -1,132 +1,4 @@ -const ophirofox_config_list = [ - { - name: "ULM", - domains: ["ens.fr"], - LOGIN_URL: "http://proxy.rubens.ens.fr/login", - // URL à charger pour pouvoir se logger sans mot de passe - AUTH_URL: - "https://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1", - }, - { - name: "ENSAM", - domains: ["ensam.eu"], - LOGIN_URL: "http://rp1.ensam.eu/login", - AUTH_URL: - "https://rp1.ensam.eu/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=AML", - }, - { - name: "Université Paris-Saclay", - domains: ["universite-paris-saclay.fr"], - LOGIN_URL: "https://ezproxy.universite-paris-saclay.fr/login", - AUTH_URL: - "https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9", - }, - { - name: "Université Paris 1 Panthéon-Sorbonne", - domains: ["univ-paris1.fr"], - LOGIN_URL: "https://ezpaarse.univ-paris1.fr/login", - AUTH_URL: - "https://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1", - }, - { - name: "INSA Lyon", - domains: ["insa-lyon.fr"], - LOGIN_URL: "https://docelec.insa-lyon.fr/login", - AUTH_URL: - "https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3", - }, - { - name: "BNF", - domains: ["bnf.fr"], - LOGIN_URL: "https://bnf.idm.oclc.org/login", - AUTH_URL: - "https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032999T_1", - }, - { - name: "Université Grenoble-Alpes", - domains: ["grenet.fr"], - LOGIN_URL: "https://sid2nomade-2.grenet.fr/login", - AUTH_URL: - "https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1", - }, - { - name: "Université de Montpellier", - domains: ["scdi-montpellier.fr"], - LOGIN_URL: "https://ezpum.scdi-montpellier.fr/login", - AUTH_URL: - "https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1", - }, - { - name: "Université Bordeaux Montaigne", - domains: ["u-bordeaux-montaigne.fr"], - LOGIN_URL: "https://www.ezproxy.u-bordeaux-montaigne.fr/login", - AUTH_URL: - "https://www.ezproxy.u-bordeaux-montaigne.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVMONTAIGNET_1", - }, - { - name: "Université de Bordeaux", - domains: ["u-bordeaux.fr"], - LOGIN_URL: "https://docelec.u-bordeaux.fr/login", - AUTH_URL: - "https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1", - }, - { - name: "ENS de Lyon", - domains: ["ens-lyon.fr"], - LOGIN_URL: "https://acces.bibliotheque-diderot.fr/login", - AUTH_URL: - "https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1", - }, - { - name: "Université de Haute-Alsace", - domains: ["uha.fr"], - LOGIN_URL: "https://scd-proxy.uha.fr/login", - AUTH_URL: - "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1", - }, - { - name: "Université Paris Cité", - domains:["u-paris.fr"], - LOGIN_URL: "https://ezproxy.u-paris.fr/login", - AUTH_URL: - "https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS", - }, - { - name: "Université de Franche-Comté", - domains: ["univ-fcomte.fr"], - LOGIN_URL: "http://scd1.univ-fcomte.fr/login", - AUTH_URL: - "http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1", - }, - { - name: "Université de Pau et des Pays de l'Adour", - domains: ["univ-pau.fr"], - LOGIN_URL: "https://rproxy.univ-pau.fr/login", - AUTH_URL: - "https://rproxy.univ-pau.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=uppaT_2", - }, - { - name: "Université d'Artois", - domains: ["univ-arrtois.fr"], - LOGIN_URL: "http://ezproxy.univ-artois.fr/login", - AUTH_URL: - "http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1", - }, - { - name: "Pas d'intermédiaire", - domains: ["europresse.com"], - LOGIN_URL: null, - AUTH_URL: "https://nouveau.europresse.com/Login", - } -]; - -/** - * Get the config for a given domain - * @param {string} domain - */ -function getOphirofoxConfigByDomain(domain) { - return ophirofox_config_list.find(({ domains }) => domains.includes(domain)); -} +const ophirofox_config_list = chrome.runtime.getManifest().browser_specific_settings.ophirofox_metadata.partners; /** * Get the config with the given name @@ -137,7 +9,7 @@ function getOphirofoxConfigByName(search_name) { } const DEFAULT_SETTINGS = { - partner_name: "ULM", + partner_name: "BNF", }; const OPHIROFOX_SETTINGS_KEY = "ophirofox_settings"; @@ -176,10 +48,6 @@ async function setSettings(settings) { async function getOphirofoxConfig() { const url = new URL(window.location); - const domain = url.host.split(".").slice(-2).join("."); - // Si la page actuelle est spécifique à une configuration, alors on l'utilise - const domain_match = getOphirofoxConfigByDomain(domain); - if (domain_match) return domain_match; try { const { partner_name } = await getSettings(); const name_match = getOphirofoxConfigByName(partner_name); @@ -196,28 +64,21 @@ async function getOphirofoxConfig() { const ophirofox_config = getOphirofoxConfig(); /** - * Crée un lien vers une recherche europresse pré-remplie avec les termes de recherche passés en argument + * Crée un lien vers Europresse avec les keywords donnés * @param {string} keywords - * @returns {URL} + * @returns {Promise} */ -async function makeOphirofoxReadingLink(keywords) { - const target_url = new URL("https://nouveau.europresse.com/Search/Reading"); - target_url.searchParams.set("ophirofox_source", window.location); - target_url.searchParams.set("ophirofox_keywords", keywords); - const config = await ophirofox_config; - if (config.LOGIN_URL) { - return new URL(`${config.LOGIN_URL}?url=${target_url}`); - } else { - return target_url; +async function ophirofoxEuropresseLink(keywords) { + keywords = keywords ? keywords.trim() : document.querySelector("h1").textContent; + const a = document.createElement("a"); + a.textContent = "Lire sur Europresse"; + a.className = "ophirofox-europresse"; + a.onclick = function (evt) { + evt.preventDefault(); + chrome.storage.local.set({ "ophirofox_keywords": keywords }, () => { + ophirofox_config.then(({ AUTH_URL }) => window.location = AUTH_URL); + }); } -} - -if (window.location.protocol.includes("extension")) { - window.ophirofox_config_exports = { - ophirofox_config_list, - ophirofox_config, - makeOphirofoxReadingLink, - getSettings, - setSettings, - }; + ophirofox_config.then(({ AUTH_URL }) => { a.href = AUTH_URL }); + return a; } diff --git a/ophirofox/content_scripts/courrier-international.css b/ophirofox/content_scripts/courrier-international.css index dbf9b8c..6613018 100644 --- a/ophirofox/content_scripts/courrier-international.css +++ b/ophirofox/content_scripts/courrier-international.css @@ -1,4 +1,3 @@ .ophirofox-europresse { margin-left: 10px; - background-color: #FFDF00; } \ No newline at end of file diff --git a/ophirofox/content_scripts/courrier-international.js b/ophirofox/content_scripts/courrier-international.js index a2b2511..218bb6d 100644 --- a/ophirofox/content_scripts/courrier-international.js +++ b/ophirofox/content_scripts/courrier-international.js @@ -1,17 +1,6 @@ -async function makeEuropresseUrl() { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - -function extractKeywords() { - return document.querySelector("h1").textContent; -} - async function createLink() { - const a = document.createElement("a"); - a.href = await makeEuropresseUrl(new URL(window.location)); - a.textContent = "Lire sur Europresse"; - a.className = "info-reserved ophirofox-europresse"; + const a = await ophirofoxEuropresseLink(); + a.classList.add("info-reserved"); return a; } diff --git a/ophirofox/content_scripts/europresse_login.js b/ophirofox/content_scripts/europresse_login.js deleted file mode 100644 index b4e9d5c..0000000 --- a/ophirofox/content_scripts/europresse_login.js +++ /dev/null @@ -1,13 +0,0 @@ -if (!window.location.hash.includes("ophirofox_reloaded")) { - window.location.hash += " ophirofox_reloaded"; - document.body.innerHTML = "Authentification..."; - const ifr = document.createElement("iframe"); - ifr.width = ifr.height = 5; - ifr.onload = (_) => { - window.location.reload(); - }; - ophirofox_config.then((conf) => { - ifr.src = conf.AUTH_URL; - document.body.appendChild(ifr); - }); -} diff --git a/ophirofox/content_scripts/europresse_search.js b/ophirofox/content_scripts/europresse_search.js index e7571ba..f1896ae 100644 --- a/ophirofox/content_scripts/europresse_search.js +++ b/ophirofox/content_scripts/europresse_search.js @@ -1,6 +1,16 @@ -function onLoad() { - const url = new URL(window.location); - const search_terms = url.searchParams.get("ophirofox_keywords"); +async function consumeSearchTerms() { + return new Promise((accept, reject) => { + chrome.storage.local.get("ophirofox_keywords", + (r) => { + accept(r.ophirofox_keywords); + chrome.storage.local.remove("ophirofox_keywords"); + }); + }) +} + +async function onLoad() { + if (!window.location.pathname.startsWith("/Search/Reading")) return; + const search_terms = await consumeSearchTerms(); if (!search_terms) return; const stopwords = new Set(['d', 'l', 'et']); const keywords = search_terms @@ -9,7 +19,7 @@ function onLoad() { .filter(w => !stopwords.has(w)) .join(' '); const keyword_field = document.getElementById("Keywords"); - keyword_field.value = keywords; + keyword_field.value = 'TIT_HEAD=' + keywords; keyword_field.form.submit(); } diff --git a/ophirofox/content_scripts/humanite.js b/ophirofox/content_scripts/humanite.js index 9832d2e..8e7f85a 100644 --- a/ophirofox/content_scripts/humanite.js +++ b/ophirofox/content_scripts/humanite.js @@ -1,20 +1,8 @@ -async function makeEuropresseUrl() { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - -function extractKeywords() { - return document.querySelector("h1").textContent; -} - async function createLink() { - const a = document.createElement("a"); - a.href = await makeEuropresseUrl(new URL(window.location)); - a.textContent = "Lire sur Europresse"; - + const a = await ophirofoxEuropresseLink(); + const div = document.createElement("div"); div.className = "field-name-field-news-auteur ophirofox-europresse"; - div.appendChild(a); return div; diff --git a/ophirofox/content_scripts/la-montagne.js b/ophirofox/content_scripts/la-montagne.js index 284d82e..b47880c 100644 --- a/ophirofox/content_scripts/la-montagne.js +++ b/ophirofox/content_scripts/la-montagne.js @@ -1,8 +1,3 @@ -async function makeEuropresseUrl() { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - function extractKeywords() { return document.querySelector("h1").textContent; } @@ -12,9 +7,9 @@ async function createLink() { span.textContent = "Lire sur Europresse"; span.className = "premium-message ophirofox-europresse"; - const a = document.createElement("a"); - a.href = await makeEuropresseUrl(new URL(window.location)); - + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("btn", "btn--premium"); + a.innerHTML = ""; a.appendChild(span); return a; diff --git a/ophirofox/content_scripts/lacroix.css b/ophirofox/content_scripts/lacroix.css index ef5164d..a74ad84 100644 --- a/ophirofox/content_scripts/lacroix.css +++ b/ophirofox/content_scripts/lacroix.css @@ -19,3 +19,7 @@ vertical-align: middle; width: 120px; } + +.above-image-wrapper { + align-items: center; +} \ No newline at end of file diff --git a/ophirofox/content_scripts/lacroix.js b/ophirofox/content_scripts/lacroix.js index d788801..d05d2a5 100644 --- a/ophirofox/content_scripts/lacroix.js +++ b/ophirofox/content_scripts/lacroix.js @@ -1,23 +1,5 @@ -async function makeEuropresseUrl(lacroixUrl) { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - -function extractKeywords() { - return extractKeywordsFromTitle(); -} - -function extractKeywordsFromTitle() { - const titleElem = document.querySelector(".tag-subscriber"); - return titleElem && titleElem.textContent; -} - async function createLink() { - const a = document.createElement("a"); - a.textContent = "Lire sur Europresse"; - a.className = "ophirofox-europresse"; - a.href = await makeEuropresseUrl(new URL(window.location)); - return a; + return await ophirofoxEuropresseLink(); } async function onLoad() { diff --git a/ophirofox/content_scripts/le-point.js b/ophirofox/content_scripts/le-point.js index 0e7de5a..6aeb259 100644 --- a/ophirofox/content_scripts/le-point.js +++ b/ophirofox/content_scripts/le-point.js @@ -1,22 +1,8 @@ -async function makeEuropresseUrl() { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - -function extractKeywords() { - return document.querySelector("h1").textContent; -} - async function createLink() { - const a = document.createElement("a"); - a.textContent = "Lire sur Europresse"; - a.href = await makeEuropresseUrl(new URL(window.location)); - + const a = await ophirofoxEuropresseLink(); const span = document.createElement("span"); span.className = "ophirofox-europresse"; - span.appendChild(a); - return span; } diff --git a/ophirofox/content_scripts/lefigaro.js b/ophirofox/content_scripts/lefigaro.js index 0f53b42..c53f394 100644 --- a/ophirofox/content_scripts/lefigaro.js +++ b/ophirofox/content_scripts/lefigaro.js @@ -1,17 +1,10 @@ -async function makeEuropresseUrl() { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - function extractKeywords() { return document.querySelector("h1").textContent; } async function createLink() { - const a = document.createElement("a"); - a.href = await makeEuropresseUrl(new URL(window.location)); - a.textContent = "Lire sur Europresse"; - a.className = "fig-premium-mark-article__text ophirofox-europresse"; + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("fig-premium-mark-article__text"); return a; } diff --git a/ophirofox/content_scripts/lemonde.js b/ophirofox/content_scripts/lemonde.js index 7fef21f..789baf2 100644 --- a/ophirofox/content_scripts/lemonde.js +++ b/ophirofox/content_scripts/lemonde.js @@ -1,11 +1,3 @@ -async function makeEuropresseUrl(lemondeUrl) { - const m = lemondeUrl.pathname.match(/(\d{4})\/(\d{2})\/(\d{2})\/.*?(\d+_\d+).html/); - if (!m) throw new Error("Format d'URL lemonde inconnu"); - // docKey : `news·${m[1]}${m[2]}${m[3]}·LMF·${m[4]}`); - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - function extractKeywords() { return extractKeywordsFromTitle() || extractKeywordsFromUrl(window.location); } @@ -23,10 +15,8 @@ function extractKeywordsFromUrl(url) { } async function createLink() { - const a = document.createElement("a"); - a.textContent = "Lire sur Europresse"; - a.className = "btn btn--premium ophirofox-europresse"; - a.href = await makeEuropresseUrl(new URL(window.location)); + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("btn", "btn--premium"); return a; } diff --git a/ophirofox/content_scripts/lesoir.css b/ophirofox/content_scripts/lesoir.css new file mode 100644 index 0000000..789d488 --- /dev/null +++ b/ophirofox/content_scripts/lesoir.css @@ -0,0 +1,3 @@ +.ophirofox-europresse { + margin-left: 10px; +} diff --git a/ophirofox/content_scripts/lesoir.js b/ophirofox/content_scripts/lesoir.js new file mode 100644 index 0000000..54d645e --- /dev/null +++ b/ophirofox/content_scripts/lesoir.js @@ -0,0 +1,25 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("fig-premium-mark-article__text"); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector("h1"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.textContent.includes("réservé aux abonnés")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + premiumBanner.after(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/liberation.js b/ophirofox/content_scripts/liberation.js index 6c32bd0..ddcdcb0 100644 --- a/ophirofox/content_scripts/liberation.js +++ b/ophirofox/content_scripts/liberation.js @@ -1,8 +1,3 @@ -async function makeEuropresseUrl() { - const keywords = extractKeywords(window.location); - return await makeOphirofoxReadingLink(keywords); -} - function extractKeywords() { return document .querySelector("meta[property='og:title']") @@ -10,10 +5,8 @@ function extractKeywords() { } async function createLink() { - const a = document.createElement("a"); - a.href = await makeEuropresseUrl(new URL(window.location)); - a.textContent = "Lire sur Europresse"; - a.className = "ribbon-premium ophirofox-europresse"; + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("ribbon-premium"); return a; } diff --git a/ophirofox/content_scripts/monde-diplo.js b/ophirofox/content_scripts/monde-diplo.js index 60da016..d57194c 100644 --- a/ophirofox/content_scripts/monde-diplo.js +++ b/ophirofox/content_scripts/monde-diplo.js @@ -1,8 +1,3 @@ -async function makeEuropresseUrl(lemondeUrl) { - const keywords = extractKeywords(); - return await makeOphirofoxReadingLink(keywords); -} - function extractKeywords() { return extractKeywordsFromTitle(); } @@ -19,10 +14,8 @@ function extractKeywordsFromTitle() { } async function createLink() { - const a = document.createElement("a"); - a.textContent = "Lire sur Europresse"; - a.className = "btn btn--premium ophirofox-europresse"; - a.href = await makeEuropresseUrl(new URL(window.location)); + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("btn", "btn--premium"); return a; } diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 2f2770a..aac1152 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -1,12 +1,13 @@ { "manifest_version": 2, "name": "Ophirofox", - "version": "1.9", + "version": "2.0", "description": "Lire les articles du monde, du figaro, et d'autres journaux grâce à sa connexion europresse", "icons": { "48": "icons/48.png", "128": "icons/128.png" }, + "homepage_url": "https://ophirofox.ophir.dev/", "options_ui": { "page": "settings/options_ui.html" }, @@ -16,7 +17,9 @@ "background": { "scripts": [ "background.js" - ] + ], + "persistent": false, + "type": "module" }, "content_scripts": [ { @@ -125,78 +128,42 @@ }, { "matches": [ - "https://nouveau.europresse.com/Search/Reading*", - "https://nouveau-europresse-com.proxy.rubens.ens.fr/Search/Reading*", - "https://nouveau-europresse-com.rp1.ensam.eu/Search/Reading*", - "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/Search/Reading*", - "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Search/Reading*", - "https://nouveau-europresse-com.docelec.insa-lyon.fr/Search/Reading*", - "https://nouveau-europresse-com.bnf.idm.oclc.org/Search/Reading*", - "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Search/Reading*", - "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Search/Reading*", - "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/Reading*", - "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/Reading*", - "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/Reading*", - "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/Reading*", - "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/Reading*", - "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/Reading*", - "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*", - "https://nouveau-europresse-com.ezproxy.univ-artois.fr/Search/Reading*" - ], - "js": [ - "content_scripts/europresse_search.js" - ] - }, - { - "matches": [ - "https://nouveau.europresse.com/Login*", - "https://nouveau-europresse-com.proxy.rubens.ens.fr/Login*", - "https://nouveau-europresse-com.rp1.ensam.eu/Login*", - "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/Login*", - "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Login*", - "https://nouveau-europresse-com.docelec.insa-lyon.fr/Login*", - "https://nouveau-europresse-com.bnf.idm.oclc.org/Login*", - "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Login*", - "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Login*", - "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Login*", - "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Login*", - "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Login*", - "https://nouveau-europresse-com.scd-proxy.uha.fr/Login*", - "https://nouveau-europresse-com.ezproxy.u-paris.fr/Login*", - "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Login*", - "https://nouveau-europresse-com.rproxy.univ-pau.fr/Login*", - "https://nouveau-europresse-com.ezproxy.univ-artois.fr/Login*" + "https://www.lesoir.be/*" ], "js": [ "content_scripts/config.js", - "content_scripts/europresse_login.js" + "content_scripts/lesoir.js" + ], + "css": [ + "content_scripts/lesoir.css" ] }, { "matches": [ - "https://nouveau.europresse.com/Search/ResultMobile*", - "https://nouveau-europresse-com.proxy.rubens.ens.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.rp1.ensam.eu/Search/ResultMobile*", - "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.docelec.insa-lyon.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.bnf.idm.oclc.org/Search/ResultMobile*", - "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.docelec.u-bordeaux.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.scd-proxy.uha.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.ezproxy.u-paris.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.scd1.univ-fcomte.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.rproxy.univ-pau.fr/Search/ResultMobile*", - "https://nouveau-europresse-com.ezproxy.univ-artois.fr/Search/ResultMobile*" + "https://nouveau.europresse.com/*", + "https://nouveau-europresse-com.proxy.rubens.ens.fr/*", + "https://nouveau-europresse-com.rp1.ensam.eu/*", + "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/*", + "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/*", + "https://nouveau-europresse-com.docelec.insa-lyon.fr/*", + "https://nouveau-europresse-com.bnf.idm.oclc.org/*", + "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/*", + "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/*", + "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/*", + "https://nouveau-europresse-com.docelec.u-bordeaux.fr/*", + "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/*", + "https://nouveau-europresse-com.scd-proxy.uha.fr/*", + "https://nouveau-europresse-com.ezproxy.u-paris.fr/*", + "https://nouveau-europresse-com.scd1.univ-fcomte.fr/*", + "https://nouveau-europresse-com.rproxy.univ-pau.fr/*", + "https://nouveau-europresse-com.ezproxy.univ-artois.fr/*" ], "css": [ "content_scripts/europresse_article.css" ], "js": [ - "content_scripts/europresse_article.js" + "content_scripts/europresse_article.js", + "content_scripts/europresse_search.js" ] } ], @@ -204,6 +171,78 @@ "gecko": { "id": "{cfd3c5c2-31ec-4c1b-a28e-df38357d02d9}", "update_url": "https://github.com/lovasoa/ophirofox/releases/latest/download/update_manifest.json" + }, + "ophirofox_metadata": { + "partners": [ + { + "name": "Pas d'intermédiaire", + "AUTH_URL": "https://nouveau.europresse.com/Login" + }, + { + "name": "BNF", + "AUTH_URL": "https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032999T_1" + }, + { + "name": "ENS de Lyon", + "AUTH_URL": "https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1" + }, + { + "name": "ENSAM", + "AUTH_URL": "https://rp1.ensam.eu/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=AML" + }, + { + "name": "INSA Lyon", + "AUTH_URL": "https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3" + }, + { + "name": "ULM", + "AUTH_URL": "https://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1" + }, + { + "name": "Université Bordeaux Montaigne", + "AUTH_URL": "https://www.ezproxy.u-bordeaux-montaigne.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVMONTAIGNET_1" + }, + { + "name": "Université Grenoble-Alpes", + "AUTH_URL": "https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1" + }, + { + "name": "Université Paris 1 Panthéon-Sorbonne", + "AUTH_URL": "https://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1" + }, + { + "name": "Université Paris Cité", + "AUTH_URL": "https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS" + }, + { + "name": "Université Paris-Saclay", + "AUTH_URL": "https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9" + }, + { + "name": "Université d'Artois", + "AUTH_URL": "http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1" + }, + { + "name": "Université de Bordeaux", + "AUTH_URL": "https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1" + }, + { + "name": "Université de Franche-Comté", + "AUTH_URL": "http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1" + }, + { + "name": "Université de Haute-Alsace", + "AUTH_URL": "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1" + }, + { + "name": "Université de Montpellier", + "AUTH_URL": "https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1" + }, + { + "name": "Université de Pau et des Pays de l'Adour", + "AUTH_URL": "https://rproxy.univ-pau.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=uppaT_2" + } + ] } } -} +} \ No newline at end of file diff --git a/ophirofox/settings/options_ui.html b/ophirofox/settings/options_ui.html index 487a62a..9d0270f 100644 --- a/ophirofox/settings/options_ui.html +++ b/ophirofox/settings/options_ui.html @@ -4,17 +4,57 @@ Ophirofox configuration -

Configuration d'Ophirofox

Partenaire Europresse @@ -33,6 +73,6 @@

Configuration d'Ophirofox

- + diff --git a/ophirofox/settings/options_ui.js b/ophirofox/settings/options_ui.js index 114b369..62089f3 100644 --- a/ophirofox/settings/options_ui.js +++ b/ophirofox/settings/options_ui.js @@ -1,9 +1,3 @@ -const { - ophirofox_config_list, - getSettings, - setSettings, -} = window.ophirofox_config_exports; - const choicelist = document.getElementById("partner_choices"); const template = document.getElementById("partner_template"); const settings_promise = getSettings(); From 9423704be6f848a12979c73b3b09cee6d23cface Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Wed, 16 Aug 2023 09:05:21 +0200 Subject: [PATCH 19/22] Paris 8, Le Mans, Aix-Marseille, La libre Belgique, et Le temps (#53) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * typo * Ajout de la prise en charge de La Libre Belgique et Le Temps (Suisse) (#52) * Ajout La Libre Belgique + Le Temps * Update manifest.json : ajout La Libre Belgique + Le Temps * Update README.md : ajout La Libre Belgique + Le Temps * Update lalibre.js * Update letemps.js * Update letemps.js * Update letemps.js * Update letemps.js * Université Paris VIII (#51) * Université Paris VIII * Update ophirofox/manifest.json * Update ophirofox/manifest.json --------- Co-authored-by: Ophir LOJKINE * cohérence * ajout de l'université du Mans * ajout d'aix marseille --------- Co-authored-by: fmoncomble <59739627+fmoncomble@users.noreply.github.com> Co-authored-by: M-Boyo <115986902+M-Boyo@users.noreply.github.com> --- README.md | 8 +++-- ophirofox/content_scripts/lalibre.css | 6 ++++ ophirofox/content_scripts/lalibre.js | 18 +++++++++++ ophirofox/content_scripts/letemps.css | 3 ++ ophirofox/content_scripts/letemps.js | 25 ++++++++++++++++ ophirofox/manifest.json | 43 +++++++++++++++++++++++++-- 6 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 ophirofox/content_scripts/lalibre.css create mode 100644 ophirofox/content_scripts/lalibre.js create mode 100644 ophirofox/content_scripts/letemps.css create mode 100644 ophirofox/content_scripts/letemps.js diff --git a/README.md b/README.md index 3f1add4..9898380 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ L'extension fonctionne avec les portails universitaires suivants : - [La Montagne](https://www.lamontagne.fr) - [Le Point](https://www.lepoint.fr) - [Le Soir](https://www.lesoir.be) + - [La Libre Belgique](https://www.lalibre.be/) + - [Le Temps](https://www.letemps.ch/) Vous pouvez proposer d'autres sites en ouvrant une [demande sur github](https://github.com/lovasoa/ophirofox/issues) @@ -68,7 +70,7 @@ ophirofox est [présent sur le Chrome Webstore](https://chrome.google.com/websto image -# Comment ajouter un nouveau partenaires Europresse +# Comment ajouter un nouveau partenaire Europresse Si votre établissement a un portail Europresse, vous pouvez facilement ajouter son support à cette extension. @@ -76,9 +78,9 @@ Si votre établissement a un portail Europresse, vous pouvez facilement ajouter 2. Sur github, ouvrez [le fichier `manifest.json` de l'extension](https://github.com/lovasoa/ophirofox/blob/master/ophirofox/manifest.json). 3. Cliquez sur le crayon pour éditer le fichier. 4. Ajoutez votre université à la liste des partenaires Europresse supportés, en suivant le modèle des autres universités. - - Dans la section qui contient toutes les URLs au format `https://nouveau-europresse-com.proxy.universite.fr/Search/Reading*`, ajoutez une ligne avec l'URL du proxy europresse de votre université. + - Dans la section qui contient toutes les URLs au format `https://nouveau-europresse-com.proxy.univ-xyz.fr/Search/Reading*`, ajoutez une ligne avec l'URL du proxy europresse de votre université. - Dans la section qui contient tous les objets au format - `{ "name": "Université XYZ", "AUTH_URL": "https://rproxy.univ-xyz.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=CODE_UNIVERSITE" }` + `{ "name": "Université XYZ", "AUTH_URL": "https://proxy.univ-xyz.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=CODE_UNIVERSITE" }` , ajoutez un objet avec le nom de votre université et l'URL de son lien de connexion europresse. Vous pouvez trouver l'URL de connexion en vous connectant à votre portail d'université, puis en faisant un clic droit sur le lien de connexion à Europresse et en choisissant *Copier l'adresse du lien*. Conservez l'ordre alphabétique des universités. 5. Cliquez sur *Propose file change*. 6. Indiquez le nom de votre université dans le champ *Propose file change*. diff --git a/ophirofox/content_scripts/lalibre.css b/ophirofox/content_scripts/lalibre.css new file mode 100644 index 0000000..eb9eb45 --- /dev/null +++ b/ophirofox/content_scripts/lalibre.css @@ -0,0 +1,6 @@ +.ophirofox-europresse { + margin-left: 10px; + margin-right: 10px; + font-size: medium; + color: rgb(172, 17, 93); +} diff --git a/ophirofox/content_scripts/lalibre.js b/ophirofox/content_scripts/lalibre.js new file mode 100644 index 0000000..fdf4ac6 --- /dev/null +++ b/ophirofox/content_scripts/lalibre.js @@ -0,0 +1,18 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("ap-StoryDate-update"); + return a; +} + +async function onLoad() { + const statusElem = document.getElementsByClassName("ap-PaidPicto"); + if (statusElem.length == 0) return; + statusElem[0].after(await createLink()); +} + + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/letemps.css b/ophirofox/content_scripts/letemps.css new file mode 100644 index 0000000..789d488 --- /dev/null +++ b/ophirofox/content_scripts/letemps.css @@ -0,0 +1,3 @@ +.ophirofox-europresse { + margin-left: 10px; +} diff --git a/ophirofox/content_scripts/letemps.js b/ophirofox/content_scripts/letemps.js new file mode 100644 index 0000000..90ede8a --- /dev/null +++ b/ophirofox/content_scripts/letemps.js @@ -0,0 +1,25 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("ophirofox-europresse"); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector("article"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.textContent.includes("Réservé aux abonnés")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + premiumBanner.after(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index aac1152..b344cba 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -138,6 +138,30 @@ "content_scripts/lesoir.css" ] }, + { + "matches": [ + "https://www.letemps.ch/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/letemps.js" + ], + "css": [ + "content_scripts/letemps.css" + ] + }, + { + "matches": [ + "https://www.lalibre.be/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/lalibre.js" + ], + "css": [ + "content_scripts/lalibre.css" + ] + }, { "matches": [ "https://nouveau.europresse.com/*", @@ -145,6 +169,7 @@ "https://nouveau-europresse-com.rp1.ensam.eu/*", "https://nouveau-europresse-com.ezproxy.universite-paris-saclay.fr/*", "https://nouveau-europresse-com.ezpaarse.univ-paris1.fr/*", + "https://nouveau-europresse-com.accesdistant.bu.univ-paris8.fr/*", "https://nouveau-europresse-com.docelec.insa-lyon.fr/*", "https://nouveau-europresse-com.bnf.idm.oclc.org/*", "https://nouveau-europresse-com.sid2nomade-2.grenet.fr/*", @@ -156,7 +181,9 @@ "https://nouveau-europresse-com.ezproxy.u-paris.fr/*", "https://nouveau-europresse-com.scd1.univ-fcomte.fr/*", "https://nouveau-europresse-com.rproxy.univ-pau.fr/*", - "https://nouveau-europresse-com.ezproxy.univ-artois.fr/*" + "https://nouveau-europresse-com.ezproxy.univ-artois.fr/*", + "https://nouveau-europresse-com.doc-elec.univ-lemans.fr/*", + "https://nouveau-europresse-com.lama.univ-amu.fr/*" ], "css": [ "content_scripts/europresse_article.css" @@ -178,6 +205,10 @@ "name": "Pas d'intermédiaire", "AUTH_URL": "https://nouveau.europresse.com/Login" }, + { + "name": "Aix-Marseille Université", + "AUTH_URL": "https://lama.univ-amu.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U031032T_1" + }, { "name": "BNF", "AUTH_URL": "https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032999T_1" @@ -194,6 +225,10 @@ "name": "INSA Lyon", "AUTH_URL": "https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3" }, + { + "name": "Le Mans Université", + "AUTH_URL": "https://login.doc-elec.univ-lemans.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U031524T_1" + }, { "name": "ULM", "AUTH_URL": "https://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1" @@ -210,6 +245,10 @@ "name": "Université Paris 1 Panthéon-Sorbonne", "AUTH_URL": "https://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1" }, + { + "name": "Université Paris 8", + "AUTH_URL": "https://accesdistant.bu.univ-paris8.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=paris8" + }, { "name": "Université Paris Cité", "AUTH_URL": "https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS" @@ -245,4 +284,4 @@ ] } } -} \ No newline at end of file +} From 30e5077f0e1a5457475a563eb23a7de6b24c864b Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 17 Aug 2023 09:38:37 +0200 Subject: [PATCH 20/22] =?UTF-8?q?Universit=C3=A9=20C=C3=B4te=20d'Azur=20ad?= =?UTF-8?q?ded=20+=20manifest=20in=20alphabetical=20order=20(#54)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update manifest.json for unice * Update README.md for unice * Update manifest.json Unice * Update manifest.json - Back in alphabetical order --- README.md | 1 + ophirofox/manifest.json | 47 +++++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 9898380..24f7b54 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ L'extension fonctionne avec les portails universitaires suivants : - [**Europresse Bibliothèque nationale de France**](https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnf) - [**Europresse Université de Bordeaux Montaigne**](https://www.ezproxy.u-bordeaux-montaigne.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVMONTAIGNET_1) - [**Europresse Université de Bordeaux**](https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1) + - [**Europresse Université Côte d'Azur**](http://proxy.unice.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032557T_1) - [**Europresse Université de Montpellier**](https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1) - [**Europresse Université de Grenoble**](https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1) - [**Europresse Université de Haute-Alsace**](https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1) diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index b344cba..2d6423b 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -176,6 +176,7 @@ "https://nouveau-europresse-com.ezpum.scdi-montpellier.fr/*", "https://nouveau-europresse-com.ezproxy.u-bordeaux-montaigne.fr/*", "https://nouveau-europresse-com.docelec.u-bordeaux.fr/*", + "https://nouveau-europresse-com.proxy.unice.fr/*", "https://nouveau-europresse-com.acces.bibliotheque-diderot.fr/*", "https://nouveau-europresse-com.scd-proxy.uha.fr/*", "https://nouveau-europresse-com.ezproxy.u-paris.fr/*", @@ -233,14 +234,38 @@ "name": "ULM", "AUTH_URL": "https://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1" }, + { + "name": "Université d'Artois", + "AUTH_URL": "http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1" + }, + { + "name": "Université de Bordeaux", + "AUTH_URL": "https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1" + }, { "name": "Université Bordeaux Montaigne", "AUTH_URL": "https://www.ezproxy.u-bordeaux-montaigne.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVMONTAIGNET_1" }, + { + "name": "Université Côte d'Azur", + "AUTH_URL": "http://proxy.unice.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032557T_1" + }, + { + "name": "Université de Franche-Comté", + "AUTH_URL": "http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1" + }, { "name": "Université Grenoble-Alpes", "AUTH_URL": "https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1" }, + { + "name": "Université de Haute-Alsace", + "AUTH_URL": "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1" + }, + { + "name": "Université de Montpellier", + "AUTH_URL": "https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1" + }, { "name": "Université Paris 1 Panthéon-Sorbonne", "AUTH_URL": "https://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1" @@ -257,30 +282,10 @@ "name": "Université Paris-Saclay", "AUTH_URL": "https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9" }, - { - "name": "Université d'Artois", - "AUTH_URL": "http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1" - }, - { - "name": "Université de Bordeaux", - "AUTH_URL": "https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1" - }, - { - "name": "Université de Franche-Comté", - "AUTH_URL": "http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1" - }, - { - "name": "Université de Haute-Alsace", - "AUTH_URL": "https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1" - }, - { - "name": "Université de Montpellier", - "AUTH_URL": "https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1" - }, { "name": "Université de Pau et des Pays de l'Adour", "AUTH_URL": "https://rproxy.univ-pau.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=uppaT_2" - } + } ] } } From fc70ad42855b4e89d0e30f76ad5bbebe7ad0a1ce Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Thu, 17 Aug 2023 11:22:31 +0200 Subject: [PATCH 21/22] Update README.md --- README.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 24f7b54..9e8034f 100644 --- a/README.md +++ b/README.md @@ -16,25 +16,27 @@ d'être redirigé automatiquement vers une page de recherche europresse qui cont ## Partenaires Europresse supportés L'extension fonctionne avec les portails universitaires suivants : - - [**Europresse ENS Ulm PSL**](http://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1), + - [**Europresse Bibliothèque nationale de France**](https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnf) - [**Europresse ENS Lyon**](https://acces.bibliotheque-diderot.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=ENSLYONT_1), + - [**Europresse ENS Ulm PSL**](http://proxy.rubens.ens.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=PSLT_1), - [**Europresse ENSAM (Arts et Métiers)**](http://rp1.ensam.eu/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=AML), - - [**Europresse Université Paris-Saclay**](https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9), - - [**Europresse Université Paris 1 Panthéon-Sorbonne**](http://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1), - [**Europresse INSA Lyon**](https://docelec.insa-lyon.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=INSAT_3) - - [**Europresse Bibliothèque nationale de France**](https://bnf.idm.oclc.org/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=bnf) + - [**Europresse Université Côte d'Azur**](http://proxy.unice.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032557T_1) + - [**Europresse Université Paris 1 Panthéon-Sorbonne**](http://ezpaarse.univ-paris1.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=SORBONNET_1), + - [**Europresse Université Paris Cité**](https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS) + - [**Europresse Université Paris-Saclay**](https://ezproxy.universite-paris-saclay.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=U031535T_9), + - [**Europresse Université d'Aix-Marseille**](https://lama.univ-amu.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U031032T_1) + - [**Europresse Université d'Artois**](http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1) - [**Europresse Université de Bordeaux Montaigne**](https://www.ezproxy.u-bordeaux-montaigne.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVMONTAIGNET_1) - [**Europresse Université de Bordeaux**](https://docelec.u-bordeaux.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVBORDEAUXT_1) - - [**Europresse Université Côte d'Azur**](http://proxy.unice.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U032557T_1) - - [**Europresse Université de Montpellier**](https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1) + - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) - [**Europresse Université de Grenoble**](https://sid2nomade-2.grenet.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=grenobleT_1) - [**Europresse Université de Haute-Alsace**](https://scd-proxy.uha.fr/login?url=http://nouveau.europresse.com/access/ip/default.aspx?un=ALSACET_1) - - [**Europresse Université Paris Cité**](https://ezproxy.u-paris.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=UNIVPARIS) - - [**Europresse Université de Franche-Comté**](http://scd1.univ-fcomte.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=FCOMTET_1) + - [**Europresse Université de Montpellier**](https://ezpum.scdi-montpellier.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=MontpellierT_1) - [**Europresse Université de Pau et des pays de l'Adour**](https://nouveau-europresse-com.rproxy.univ-pau.fr/access/ip/default.aspx?un=uppaT_2) - - [**Europresse Université d'Artois**](http://ezproxy.univ-artois.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=littoralT_1) - - Ou directement via le site Europresse. + - [**Europresse Université du Mans**](https://login.doc-elec.univ-lemans.fr/login?url=https://nouveau.europresse.com/access/ip/default.aspx?un=U031524T_1) + +Ou directement via le site Europresse. ## Sites supportés - [Le Monde](https://www.lemonde.fr/) From e4ec4a44bb562a03788353b214d5c6f957b94efe Mon Sep 17 00:00:00 2001 From: fmoncomble <59739627+fmoncomble@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:40:21 +0200 Subject: [PATCH 22/22] =?UTF-8?q?Ajout=20de=20quelques=20titres=20de=20pre?= =?UTF-8?q?sse=20r=C3=A9gionale=20(#55)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update README.md : ajout presse régionale + division sites supportés en sections + mise en ordre alphabétique des sites supportés * Update manifest.json : ajout presse régionale * Update manifest.json : ajout presse régionale * Ajout presse régionale Le Parisien, La Dépêche du Midi, La Provence, Sud Ouest, Ouest France, La Voix du Nord * Correction classification * Update ophirofox/content_scripts/la-provence.js Co-authored-by: Ophir LOJKINE * Update ophirofox/content_scripts/la-depeche.js Co-authored-by: Ophir LOJKINE --------- Co-authored-by: Ophir LOJKINE --- README.md | 28 ++++++--- ophirofox/content_scripts/la-depeche.css | 8 +++ ophirofox/content_scripts/la-depeche.js | 22 +++++++ ophirofox/content_scripts/la-provence.css | 6 ++ ophirofox/content_scripts/la-provence.js | 21 +++++++ ophirofox/content_scripts/lavdn.css | 4 ++ ophirofox/content_scripts/lavdn.js | 26 ++++++++ ophirofox/content_scripts/le-parisien.css | 13 ++++ ophirofox/content_scripts/le-parisien.js | 26 ++++++++ ophirofox/content_scripts/ouestfrance.css | 11 ++++ ophirofox/content_scripts/ouestfrance.js | 27 +++++++++ ophirofox/content_scripts/sudouest.css | 15 +++++ ophirofox/content_scripts/sudouest.js | 25 ++++++++ ophirofox/manifest.json | 72 +++++++++++++++++++++++ 14 files changed, 296 insertions(+), 8 deletions(-) create mode 100644 ophirofox/content_scripts/la-depeche.css create mode 100644 ophirofox/content_scripts/la-depeche.js create mode 100644 ophirofox/content_scripts/la-provence.css create mode 100644 ophirofox/content_scripts/la-provence.js create mode 100644 ophirofox/content_scripts/lavdn.css create mode 100644 ophirofox/content_scripts/lavdn.js create mode 100644 ophirofox/content_scripts/le-parisien.css create mode 100644 ophirofox/content_scripts/le-parisien.js create mode 100644 ophirofox/content_scripts/ouestfrance.css create mode 100644 ophirofox/content_scripts/ouestfrance.js create mode 100644 ophirofox/content_scripts/sudouest.css create mode 100644 ophirofox/content_scripts/sudouest.js diff --git a/README.md b/README.md index 9e8034f..a330e7b 100644 --- a/README.md +++ b/README.md @@ -39,18 +39,30 @@ L'extension fonctionne avec les portails universitaires suivants : Ou directement via le site Europresse. ## Sites supportés - - [Le Monde](https://www.lemonde.fr/) + +### Presse nationale + - [L'Humanité](https://www.humanite.fr) + - [La Croix](https://www.la-croix.com) - [Le Figaro](https://www.lefigaro.fr/) - - [Libération](https://www.liberation.fr/) - [Le Monde Diplomatique](https://www.www.monde-diplomatique.fr) - - [La Croix](https://www.la-croix.com) - - [Courrier international](https://www.courrierinternational.com) - - [L'Humanité](https://www.humanite.fr) - - [La Montagne](https://www.lamontagne.fr) + - [Le Monde](https://www.lemonde.fr/) - [Le Point](https://www.lepoint.fr) - - [Le Soir](https://www.lesoir.be) + - [Libération](https://www.liberation.fr/) + +### Presse régionale + - [La Dépêche du Midi](https://www.ladepeche.fr/) + - [La Montagne](https://www.lamontagne.fr) + - [La Provence](https://www.laprovence.com/) + - [La Voix du Nord](https://www.lavoixdunord.fr/) + - [Le Parisien](https://www.leparisien.fr/) + - [Ouest France](https://www.ouest-france.fr/) + - [Sud Ouest](https://www.sudouest.fr/) + +### Presse étrangère + - [Courrier international](https://www.courrierinternational.com) - [La Libre Belgique](https://www.lalibre.be/) - - [Le Temps](https://www.letemps.ch/) + - [Le Soir (Belgique)](https://www.lesoir.be) + - [Le Temps (Suisse)](https://www.letemps.ch/) Vous pouvez proposer d'autres sites en ouvrant une [demande sur github](https://github.com/lovasoa/ophirofox/issues) diff --git a/ophirofox/content_scripts/la-depeche.css b/ophirofox/content_scripts/la-depeche.css new file mode 100644 index 0000000..cf86324 --- /dev/null +++ b/ophirofox/content_scripts/la-depeche.css @@ -0,0 +1,8 @@ +.ophirofox-europresse { + background-color: #f2c94c; + color: #695106; + font-family: Lato,Lato-fallback,Arial,Helvetica,sans-serif; + padding: 1em; + vertical-align: middle; + border-radius: 0.5rem; +} diff --git a/ophirofox/content_scripts/la-depeche.js b/ophirofox/content_scripts/la-depeche.js new file mode 100644 index 0000000..c266a3a --- /dev/null +++ b/ophirofox/content_scripts/la-depeche.js @@ -0,0 +1,22 @@ +async function createLink() { + const a = await ophirofoxEuropresseLink(); + a.classList.add(); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector(".article-full__media.article__media--premium.ratio-target"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.classList.contains("article--premium__label")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + const head = document.querySelector("h1"); + head.after(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/la-provence.css b/ophirofox/content_scripts/la-provence.css new file mode 100644 index 0000000..b5a563c --- /dev/null +++ b/ophirofox/content_scripts/la-provence.css @@ -0,0 +1,6 @@ +.ophirofox-europresse { + color: black; + margin-left: 7px; + padding: 0.4em 0.6em; + background-color: #ffcd1d; +} diff --git a/ophirofox/content_scripts/la-provence.js b/ophirofox/content_scripts/la-provence.js new file mode 100644 index 0000000..63da85e --- /dev/null +++ b/ophirofox/content_scripts/la-provence.js @@ -0,0 +1,21 @@ +async function createLink() { + const a = await ophirofoxEuropresseLink(); + a.classList.add(); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector(".header-article-premium__stamp"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.textContent.includes("Article réservé aux abonnés")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + premiumBanner.appendChild(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/lavdn.css b/ophirofox/content_scripts/lavdn.css new file mode 100644 index 0000000..65f1b41 --- /dev/null +++ b/ophirofox/content_scripts/lavdn.css @@ -0,0 +1,4 @@ +.ophirofox-europresse { + padding: 8px 12px; + border-radius: 8px; +} diff --git a/ophirofox/content_scripts/lavdn.js b/ophirofox/content_scripts/lavdn.js new file mode 100644 index 0000000..3ded70f --- /dev/null +++ b/ophirofox/content_scripts/lavdn.js @@ -0,0 +1,26 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("r-btn--secondary"); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector("article"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.textContent.includes("réservé aux abonnés")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + const head = document.querySelector("h1"); + head.before(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/le-parisien.css b/ophirofox/content_scripts/le-parisien.css new file mode 100644 index 0000000..522d439 --- /dev/null +++ b/ophirofox/content_scripts/le-parisien.css @@ -0,0 +1,13 @@ +.ophirofox-europresse { + background-color: #fc3; + color: black; + font-family: GraphikCompact,Arial,sans-serif; + font-weight: 600; + letter-spacing: .02em; + font-size: 1rem; + line-height: 1.5rem; + text-decoration: none; + border-radius: 1.25rem; + padding: 0.7em; + vertical-align: middle; +} diff --git a/ophirofox/content_scripts/le-parisien.js b/ophirofox/content_scripts/le-parisien.js new file mode 100644 index 0000000..d1aae3b --- /dev/null +++ b/ophirofox/content_scripts/le-parisien.js @@ -0,0 +1,26 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add(); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector(".paywall-sticky.width_full.d_flex.pt_3_m.pb_3_m.pt_4_nm.pb_4_nm.pos_stick.ff_gct.fw_r.justify_center"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("div"); + return [...elems].find(d => d.textContent.includes("Cet article est réservé aux abonnés")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + const head = document.querySelector("h1"); + head.after(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/ouestfrance.css b/ophirofox/content_scripts/ouestfrance.css new file mode 100644 index 0000000..89cefcf --- /dev/null +++ b/ophirofox/content_scripts/ouestfrance.css @@ -0,0 +1,11 @@ +.ophirofox-europresse { + background: #cba200; + color: #fff; + text-transform: none; + text-decoration: none; + border: 0; + font-weight: var(--font-weight-bold); + border-radius: 8px; + box-sizing: border-box; + padding: 8px 12px; +} \ No newline at end of file diff --git a/ophirofox/content_scripts/ouestfrance.js b/ophirofox/content_scripts/ouestfrance.js new file mode 100644 index 0000000..e97f3a3 --- /dev/null +++ b/ophirofox/content_scripts/ouestfrance.js @@ -0,0 +1,27 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add("ophirofox-europresse"); + a.style.cssText = 'color:white;border-bottom:none'; + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector(".su-premium-info"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.textContent.includes("Article premium")) +} + +async function onLoad() { + const premiumBanner = findPremiumBanner(); + if (!premiumBanner) return; + const head = document.querySelector("h1"); + head.after(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/content_scripts/sudouest.css b/ophirofox/content_scripts/sudouest.css new file mode 100644 index 0000000..e8cf757 --- /dev/null +++ b/ophirofox/content_scripts/sudouest.css @@ -0,0 +1,15 @@ +.ophirofox-europresse { + color: black; + margin-left: 7px; + padding: 0.4em 0.6em; + background-color: #ffc400; + font-size: 10px; + font-family: "SF Text","Helvetica Neue","Helvetica","Open Sans","Arial",sans-serif; + line-height: 1em; + border-radius: 0; + display: inline-block; + width: auto; + text-transform: uppercase; + font-weight: 700; + height: auto; +} diff --git a/ophirofox/content_scripts/sudouest.js b/ophirofox/content_scripts/sudouest.js new file mode 100644 index 0000000..817e8b2 --- /dev/null +++ b/ophirofox/content_scripts/sudouest.js @@ -0,0 +1,25 @@ +function extractKeywords() { + return document.querySelector("h1").textContent; +} + +async function createLink() { + const a = await ophirofoxEuropresseLink(extractKeywords()); + a.classList.add(); + return a; +} + + +function findPremiumBanner() { + const title = document.querySelector(".tag.color-premium.uppercase"); + if (!title) return null; + const elems = title.parentElement.querySelectorAll("span"); + return [...elems].find(d => d.textContent.includes("Réservé aux abonnés")) +} + +async function onLoad() { + const head = document.querySelector(".article-premium-header"); + if (!head) return; + head.appendChild(await createLink()); +} + +onLoad().catch(console.error); diff --git a/ophirofox/manifest.json b/ophirofox/manifest.json index 2d6423b..67d0f6b 100644 --- a/ophirofox/manifest.json +++ b/ophirofox/manifest.json @@ -162,6 +162,78 @@ "content_scripts/lalibre.css" ] }, + { + "matches": [ + "https://www.lavoixdunord.fr/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/lavdn.js" + ], + "css": [ + "content_scripts/lavdn.css" + ] + }, + { + "matches": [ + "https://www.ouest-france.fr/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/ouestfrance.js" + ], + "css": [ + "content_scripts/ouestfrance.css" + ] + }, + { + "matches": [ + "https://www.sudouest.fr/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/sudouest.js" + ], + "css": [ + "content_scripts/sudouest.css" + ] + }, + { + "matches": [ + "https://www.laprovence.com/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/la-provence.js" + ], + "css": [ + "content_scripts/la-provence.css" + ] + }, + { + "matches": [ + "https://www.ladepeche.fr/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/la-depeche.js" + ], + "css": [ + "content_scripts/la-depeche.css" + ] + }, + { + "matches": [ + "https://www.leparisien.fr/*" + ], + "js": [ + "content_scripts/config.js", + "content_scripts/le-parisien.js" + ], + "css": [ + "content_scripts/le-parisien.css" + ] + }, { "matches": [ "https://nouveau.europresse.com/*",