diff --git a/README.md b/README.md index 8e8d1b9..4689209 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ On a book page on Bookshop.org, Amazon (`.fr`/`.com`), Waterstones, or Google Bo - `bookshop.org/p/books/*` - `waterstones.com/book/*` - `amazon.fr` and `amazon.com` product pages (`/dp/*`) -- Google Books (`books.google.com/books?id=…`, `google.com/books/edition/…`) +- Google Books (`books.google.com/books?id=…`, `google.com/books/edition/…`, and the `.fr` equivalents) ## Notes diff --git a/book-links.user.js b/book-links.user.js index d694cf5..e686c6c 100644 --- a/book-links.user.js +++ b/book-links.user.js @@ -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 };