From 95c0195c22c7494b6f8674fca6dfe6d53406ab92 Mon Sep 17 00:00:00 2001 From: Alex Shnitman Date: Fri, 9 Jul 2021 15:09:27 +0300 Subject: firefox bookmarklet --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index de9cc1a..3997f46 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Certain values can be set via environment variables, using the `-e` parameter on ## Bookmarklet -[kushfest](https://github.com/kushfest) has created a bookmarklet for sending the currently open webpage to MeTube. Please note that if you're on an HTTPS page, your MeTube instance must be behind an HTTPS reverse proxy (see below) for the bookmarklet to work. +[kushfest](https://github.com/kushfest) has created a Chrome bookmarklet for sending the currently open webpage to MeTube. Please note that if you're on an HTTPS page, your MeTube instance must be behind an HTTPS reverse proxy (see below) for the bookmarklet to work. 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. @@ -47,6 +47,11 @@ GitHub doesn't allow embedding JavaScript as a link, so the bookmarklet has to b 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.")}}}(); ``` +[shoonya75](https://github.com/shoonya75) has contributed a Firefox version: +```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.")}}})(); +``` + ## Running behind a reverse proxy Use the following nginx configuration to run MeTube behind a reverse proxy. The extra `proxy_set_header` directives are there to make WebSocket work. Don't forget to set the URL_PREFIX environment variable to the correct value as well. -- cgit