arte_download_button: Renamed functions and variables names.

They are more descriptive now.
This commit is contained in:
tastytea 2019-06-18 21:01:07 +02:00
parent b20488dc0f
commit 5602b4a7e3
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 5 additions and 5 deletions

View File

@ -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;