Skip to content

Commit

Permalink
asking GreaseMonkey permission to use GM_xmlhttpRequest [Firefox]
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlath committed Sep 10, 2014
1 parent 6b3f4dd commit 410dbe4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arte-downloader.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// @description Display direct links to MP4 videos of Arte+7 programs
// @include http://www.arte.tv/guide/*
// @version 1.4
// @grant GM_xmlhttpRequest
// ==/UserScript==

// Set this to 1 to enable console logs.
Expand Down Expand Up @@ -45,7 +46,7 @@ for(var i=0; i < video_elements.length; i++) {
}

function createButton(element, quality) {

var button = document.createElement('a');
button.setAttribute('class', 'btn btn-default');
button.setAttribute('style', 'text-align: center; display: table-cell;');
Expand Down Expand Up @@ -91,8 +92,8 @@ function triggerOnClick(element, quality){
/*
* Run an X-Path query to retrieve the URL of the JSON file which contains the MP4 video URLs.
*/
function getJsonUrl(element) {
function getJsonUrl(element) {

// Get the value of the "arte_vp_url" attribute which contains the player URL.
// playerUrl = result.snapshotItem(0).getAttribute("arte_vp_url");
playerUrl = element.getAttribute("arte_vp_url");
Expand Down Expand Up @@ -126,7 +127,7 @@ function getVideoUrl(response, quality){

// Loop through all videos URLs.
for(var i = 0; i < json["video"]["VSR"].length; i++) {

// Get the videos where VFO is "HBBTV".
if(json["video"]["VSR"][i]["VFO"] === "HBBTV") {

Expand Down

0 comments on commit 410dbe4

Please sign in to comment.