forked from tastytea/userscripts
arte_download_button: Renamed functions and variables names.
They are more descriptive now.
This commit is contained in:
parent
b20488dc0f
commit
5602b4a7e3
|
@ -16,7 +16,7 @@
|
||||||
// @inject-into content
|
// @inject-into content
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
function get_api_url()
|
function get_json_url()
|
||||||
{
|
{
|
||||||
const iframes = document.getElementsByTagName("iframe");
|
const iframes = document.getElementsByTagName("iframe");
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ function get_api_url()
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_video_url(url)
|
function get_video_url(json_url)
|
||||||
{
|
{
|
||||||
const req = new Request(url);
|
const req = new Request(json_url);
|
||||||
fetch(req).then(function(response)
|
fetch(req).then(function(response)
|
||||||
{
|
{
|
||||||
return response.json();
|
return response.json();
|
||||||
|
@ -66,12 +66,12 @@ function add_button(url)
|
||||||
|
|
||||||
function main()
|
function main()
|
||||||
{
|
{
|
||||||
if (document.getElementById("tastytea_downloadbutton") !== null)
|
if (document.getElementById("tastytea_downloadbutton") !== null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = get_api_url();
|
const url = get_json_url();
|
||||||
if (url === null)
|
if (url === null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue