check on android

This commit is contained in:
Gregory Tertyshny 2024-07-15 21:47:22 +03:00
parent fec251aea9
commit 37f030f671
7 changed files with 18 additions and 31 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
node_modules
.vscode
web-ext-artifacts
.amo-upload-uuid
.amo-upload-uuid
dist

2
dist/koboprice.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -15,9 +15,18 @@ TODO:
*/
const createPricesContainer = () => {
const pricingActionContainer = document.querySelector(
".primary-right-container",
);
const pricingActionContainers = document.querySelectorAll(".pricing-details");
l("all pricing containers", pricingActionContainers);
let visible;
for (const node of pricingActionContainers) {
if (node.checkVisibility()) {
l("found visible pricing container", node);
visible = node;
break;
}
}
const container = document.createElement("div");
@ -26,10 +35,7 @@ const createPricesContainer = () => {
container.style.border = "1px solid black";
container.style.padding = "10px";
return pricingActionContainer.parentNode.insertBefore(
container,
pricingActionContainer,
);
return visible.parentNode.insertBefore(container, visible);
};
const getPrices = async () => {

View file

@ -1,12 +1,12 @@
{
"name": "Kobo Price",
"description": "Find lowest book price on kobo.com",
"version": "1.1.4",
"version": "1.1.5",
"manifest_version": 3,
"permissions": ["activeTab"],
"content_scripts": [
{
"js": ["dist/koboprice.js"],
"js": ["dist/index.js"],
"run_at": "document_end",
"matches": [
"https://www.kobo.com/*/*/ebook/*",

View file

@ -7,7 +7,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint --fix",
"build": "esbuild lib/index.js --bundle --minify --sourcemap --target=chrome58,firefox57,safari11 --outfile=dist/koboprice.js",
"build": "esbuild lib/index.js --bundle --minify --sourcemap --target=chrome58,firefox57,safari11 --outfile=dist/index.js",
"watch-build": "npm run build -- --watch",
"watch-ext": "web-ext run --start-url kobo.com",
"watch": "concurrently npm:watch-build npm:watch-ext",

View file

@ -1,11 +0,0 @@
// ==UserScript==
// @name Kobo Price
// @description finds lowest book price on kobo.com
// @icon https://github.com/fotonmoton/koboprice/blob/master/icon.png?raw=true
// @namespace https://github.com/fotonmoton
// @run-at document-end
// @noframes
// @match https://www.kobo.com/*/*/ebook/*
// @match https://www.kobo.com/*/*/audiobook/*
// @require ../dist/koboprice.js
// ==/UserScript==