From aabb978d1e815ba2a5d8b01b34ca93c2321214fa Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 27 Apr 2024 22:12:36 -0700 Subject: [PATCH] Support basic auth in Chrome bookmarklet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e40a571..141253d 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ __Firefox:__ contributed by [nanocortex](https://github.com/nanocortex). You can GitHub doesn't allow embedding JavaScript as a link, so the bookmarklet has to be created manually by copying the following code to a new bookmark you create on your bookmarks bar. Change the hostname in the URL below to point to your MeTube instance. ```javascript -javascript:!function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}}(); +javascript:!function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.withCredentials=true;xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}}(); ``` [shoonya75](https://github.com/shoonya75) has contributed a Firefox version: