Skip to content

Commit f91811a

Browse files
authored
Merge pull request #440 from arabcoders/dev
Update bookmarklet URL and add note on mixed content
2 parents f51b11c + 9801258 commit f91811a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

FAQ.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ or the `environment:` section in `compose.yaml` file.
6161
## Simple bookmarklet
6262

6363
```javascript
64-
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.")); })()
64+
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)); })()
6565
```
6666

6767
Change the the variable `url` and `preset` variables to match your YTPTube instance and preset name.
6868

69+
> [!NOTE]
70+
> The bookmarklet should be served from https page, otherwise, some browsers will block the request. for mixed content.
71+
6972
## Browser stores
7073

7174
- For Firefox via [Firefox Store](https://addons.mozilla.org/en-US/firefox/addon/ytptube-extension/)

0 commit comments

Comments
 (0)