Since Youtube is blocked in my country but some sites like https://www.Youtube-nocookie.com/embed/videoID are allowed to stream.(由于YouTube在我的国家/地区遭到封锁,但允许流播某些网站,例如https://www.Youtube-nocookie.com/embed/videoID 。)
The Question is when I click on a youtube link, Can it be redirected to www.Youtube-nocookie.com/embed/videoID ;(问题是当我单击youtube链接时,它可以重定向到www.Youtube-nocookie.com/embed/videoID吗 ?) Is it possible with Javascript or Chrome Extension(Javascript或Chrome扩展程序是否可能)
I have a sample bookmark javascript that on clicking detects youtube VideoID on current page and redirects to Youtube-Nocookie.com/embed/VideoID.(我有一个示例书签javascript,点击后会在当前页面上检测到youtube VideoID,然后重定向到Youtube-Nocookie.com/embed/VideoID。)
javascript:
var URL = location.href;
var regExp = /^.*((youtu.be/)|(v/)|(/u/w/)|(embed/)|(watch?))??v?=?([^#&?]*).*/;
var match = URL.match(regExp);
if (match&&match[7].length==11{
videoID=match[7];
window.open('https://www.youtube-nocookie.com/embed/'+videoID+'?autoplay=1');
} else {
window.open('https://www.youtube-nocookie.com/embed/');
}
ask by Sayyed Dawood translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…