Project

General

Profile

« Previous | Next » 

Revision 4c1c15ce

Added by koszko over 1 year ago

add vaticannews video enabler

View differences:

content/bvaticannews_videos/index.json
1
{
2
"type" : "bag",
3
"name" : "vaticannews_videos_through_yewtube",
4
"components" : [
5
["script", "youtube.com_2_yewtu.be_URL_converter"],
6
["script", "vaticannews_videos_through_yewtube"]
7
]
8
}
content/pvaticannews/index.json
1
{
2
"type" : "page",
3
"pattern" : "https://www.vaticannews.va/***",
4
"payload" : ["bag", "vaticannews_videos_through_yewtube"]
5
}
content/svaticannews_videos/index.json
1
{
2
"type" : "script",
3
"name" : "vaticannews_videos_through_yewtube",
4
"sha256" : "d18550582fc3483da22abad74a526f6252270f5ae2bbcba336c617b2546175ab",
5
"location" : "vaticannews_videos.js"
6
}
content/svaticannews_videos/vaticannews_videos.js
1
/**
2
 * Copyright (C) 2021, Wojtek Kosior
3
 *
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the CC0 1.0 Universal License as published by
6
 * the Creative Commons Corporation.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * CC0 1.0 Universal License for more details.
12
 * Available under the terms of Creative Commons Zero.
13
 */
14

  
15
/* Use with https://www.vaticannews.va/*** */
16

  
17
for (const iframe of document.querySelectorAll("iframe[data-src]")) {
18
    const youtube_url = iframe.getAttribute("data-src");
19
    iframe.setAttribute("src", make_yewtube_url(youtube_url));
20
}

Also available in: Unified diff