From 9801258b1c1885975567876ccf59c18b5c2662fe Mon Sep 17 00:00:00 2001 From: arabcoders Date: Mon, 13 Oct 2025 18:54:39 +0300 Subject: [PATCH] Update bookmarklet URL and add note on mixed content --- FAQ.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index f0e70d87..987747fc 100644 --- a/FAQ.md +++ b/FAQ.md @@ -61,11 +61,14 @@ or the `environment:` section in `compose.yaml` file. ## Simple bookmarklet ```javascript -javascript:(() => { const url = "https://ytptube.example.org"; const preset = "default"; const mUrl = new URL(url); mUrl.pathname = "/api/history"; fetch(mUrl, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ url: document.location.href, preset: preset }) }).then(res => alert(res.ok ? "URL sent!" : "Failed to send URL.")); })() +javascript:(() => { const url = "https://ytp.example.org"; const preset = "default"; const mUrl = new URL(url);mUrl.pathname="/api/history/add";mUrl.searchParams.set("url",document.location.href);mUrl.searchParams.set("preset",preset);fetch(mUrl,{method: "GET"}).then(j => j.json()).then(json =>alert(json.message)).catch(err =>alert(err)); })() ``` Change the the variable `url` and `preset` variables to match your YTPTube instance and preset name. +> [!NOTE] +> The bookmarklet should be served from https page, otherwise, some browsers will block the request. for mixed content. + ## Browser stores - For Firefox via [Firefox Store](https://addons.mozilla.org/en-US/firefox/addon/ytptube-extension/)