Add books.google.fr support

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X4uRGZZ4EpYHA4PNK3x5JY
This commit is contained in:
alexture 2026-09-20 16:47:54 +02:00
parent ac9c35b06d
commit 5d822caf97
2 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Book Links
// @namespace http://tampermonkey.net/
// @version 1.2
// @version 1.3
// @description Show Anna's Archive and Waterstones links when browsing books
// @license MIT
// @match https://bookshop.org/p/books/*
@ -12,6 +12,8 @@
// @match https://www.amazon.com/*/dp/*
// @match https://books.google.com/books?*
// @match https://www.google.com/books/edition/*
// @match https://books.google.fr/books?*
// @match https://www.google.fr/books/edition/*
// @connect annas-archive.gl
// @connect www.waterstones.com
// @connect www.chez-mon-libraire.fr
@ -64,7 +66,7 @@
return null;
}
if (host.includes('google.com')) {
if (host.includes('google.')) {
const text = document.body?.innerText || '';
const m13 = text.match(/\b(97[89][-\d ]{9,14}\d)\b/);
if (m13) {
@ -119,7 +121,7 @@
return { title, author };
}
if (host.includes('google.com')) {
if (host.includes('google.')) {
const title = document.querySelector('h1')?.textContent?.trim();
const author = document.querySelector('a[href*="inauthor"]')?.textContent?.trim();
return { title, author };