check on android
This commit is contained in:
parent
fec251aea9
commit
37f030f671
7 changed files with 18 additions and 31 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
node_modules
|
node_modules
|
||||||
.vscode
|
.vscode
|
||||||
web-ext-artifacts
|
web-ext-artifacts
|
||||||
.amo-upload-uuid
|
.amo-upload-uuid
|
||||||
|
dist
|
2
dist/koboprice.js
vendored
2
dist/koboprice.js
vendored
File diff suppressed because one or more lines are too long
7
dist/koboprice.js.map
vendored
7
dist/koboprice.js.map
vendored
File diff suppressed because one or more lines are too long
20
lib/index.js
20
lib/index.js
|
@ -15,9 +15,18 @@ TODO:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const createPricesContainer = () => {
|
const createPricesContainer = () => {
|
||||||
const pricingActionContainer = document.querySelector(
|
const pricingActionContainers = document.querySelectorAll(".pricing-details");
|
||||||
".primary-right-container",
|
|
||||||
);
|
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");
|
const container = document.createElement("div");
|
||||||
|
|
||||||
|
@ -26,10 +35,7 @@ const createPricesContainer = () => {
|
||||||
container.style.border = "1px solid black";
|
container.style.border = "1px solid black";
|
||||||
container.style.padding = "10px";
|
container.style.padding = "10px";
|
||||||
|
|
||||||
return pricingActionContainer.parentNode.insertBefore(
|
return visible.parentNode.insertBefore(container, visible);
|
||||||
container,
|
|
||||||
pricingActionContainer,
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPrices = async () => {
|
const getPrices = async () => {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "Kobo Price",
|
"name": "Kobo Price",
|
||||||
"description": "Find lowest book price on kobo.com",
|
"description": "Find lowest book price on kobo.com",
|
||||||
"version": "1.1.4",
|
"version": "1.1.5",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"permissions": ["activeTab"],
|
"permissions": ["activeTab"],
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
"js": ["dist/koboprice.js"],
|
"js": ["dist/index.js"],
|
||||||
"run_at": "document_end",
|
"run_at": "document_end",
|
||||||
"matches": [
|
"matches": [
|
||||||
"https://www.kobo.com/*/*/ebook/*",
|
"https://www.kobo.com/*/*/ebook/*",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"lint": "eslint --fix",
|
"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-build": "npm run build -- --watch",
|
||||||
"watch-ext": "web-ext run --start-url kobo.com",
|
"watch-ext": "web-ext run --start-url kobo.com",
|
||||||
"watch": "concurrently npm:watch-build npm:watch-ext",
|
"watch": "concurrently npm:watch-build npm:watch-ext",
|
||||||
|
|
|
@ -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==
|
|
Loading…
Reference in a new issue