Removed embedded only https://github.com/libredirect/libredirect/issues/410
This commit is contained in:
parent
140e6e525c
commit
b62c79adf8
|
@ -152,7 +152,7 @@ function redirect(url, type, initiator, disableOverride) {
|
|||
if (disableLbryTargets && !disableOverride) return
|
||||
if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) return
|
||||
if (!targets.some(rx => rx.test(url.href))) return
|
||||
if ((type == "main_frame" && lbryRedirectType == "sub_frame") || (type == "sub_frame" && lbryRedirectType == "main_frame")) return
|
||||
if (type == "sub_frame" && lbryRedirectType == "main_frame") return
|
||||
|
||||
const instancesList = getInstancesList()
|
||||
switch (type) {
|
||||
|
|
|
@ -97,7 +97,6 @@ function redirect(url, type, initiator, disableOverride) {
|
|||
if (!targets.some(rx => rx.test(url.href))) return
|
||||
if (url.pathname.split("/").includes("home")) return
|
||||
if (initiator && all().includes(initiator.origin)) return "BYPASSTAB"
|
||||
if (twitterRedirectType == "sub_frame" && type == "main_frame") return
|
||||
if (twitterRedirectType == "main_frame" && type != "main_frame") return
|
||||
|
||||
let instancesList = []
|
||||
|
|
|
@ -327,14 +327,13 @@ function getInstanceList(type) {
|
|||
return instancesList
|
||||
}
|
||||
|
||||
function redirect(url, type, initiator, disableOverride) {
|
||||
function redirect(url, type, tabId, initiator, disableOverride) {
|
||||
if (disableYoutube && !disableOverride) return
|
||||
if (!targets.some(rx => rx.test(url.href))) return
|
||||
if (initiator && all().includes(initiator.origin)) return "BYPASSTAB"
|
||||
|
||||
if (type != ("main_frame" || "sub_frame")) return
|
||||
if (url.pathname.match(/iframe_api/) || url.pathname.match(/www-widgetapi/)) return // Don't redirect YouTube Player API.
|
||||
if (onlyEmbeddedVideo == "onlyEmbedded" && type == "main_frame") return
|
||||
if (onlyEmbeddedVideo == "onlyNotEmbedded" && type == "sub_frame") return
|
||||
|
||||
if (type == "main_frame") {
|
||||
|
|
|
@ -26,7 +26,6 @@ import frontend from "../../assets/javascripts/frontend.js"
|
|||
|
||||
window.browser = window.browser || window.chrome
|
||||
|
||||
|
||||
browser.runtime.onInstalled.addListener(details => {
|
||||
function initDefaults() {
|
||||
fetch("/instances/blacklist.json")
|
||||
|
@ -90,7 +89,7 @@ browser.webRequest.onBeforeRequest.addListener(
|
|||
}
|
||||
|
||||
let newUrl = youtubeMusicHelper.redirect(url, details.type)
|
||||
if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, initiator)
|
||||
if (!newUrl) newUrl = youtubeHelper.redirect(url, details.type, details.tabId, initiator)
|
||||
if (!newUrl) newUrl = twitterHelper.redirect(url, details.type, initiator)
|
||||
if (!newUrl) newUrl = instagramHelper.redirect(url, details.type, initiator)
|
||||
if (!newUrl) newUrl = mapsHelper.redirect(url, initiator)
|
||||
|
|
|
@ -312,7 +312,6 @@
|
|||
<h4 data-localise="__MSG_redirectType__">Redirect Type</h4>
|
||||
<select id="youtube-redirect_type">
|
||||
<option value="both" data-localise="__MSG_both__">both</option>
|
||||
<option value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__">Only Embedded</option>
|
||||
<option value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__">Only Not Embedded</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -925,7 +924,6 @@
|
|||
<h4 data-localise="__MSG_redirectType__">Redirect Type</h4>
|
||||
<select id="twitter-redirect_type">
|
||||
<option value="both" data-localise="__MSG_both__">both</option>
|
||||
<option value="sub_frame" data-localise="__MSG_onlyEmbedded__">Only Embedded</option>
|
||||
<option value="main_frame" data-localise="__MSG_onlyNotEmbedded__">Only Not Embedded</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -2220,7 +2218,6 @@
|
|||
<h4 data-localise="__MSG_redirectType__">Redirect Type</h4>
|
||||
<select id="lbry-redirect_type">
|
||||
<option value="both" data-localise="__MSG_both__">both</option>
|
||||
<option value="sub_frame" data-localise="__MSG_onlyEmbedded__">Only Embedded</option>
|
||||
<option value="main_frame" data-localise="__MSG_onlyNotEmbedded__">Only Not Embedded</option>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,6 @@ section#lbry_page.option-block
|
|||
h4(data-localise="__MSG_redirectType__") Redirect Type
|
||||
select#lbry-redirect_type
|
||||
option(value="both" data-localise="__MSG_both__") both
|
||||
option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded
|
||||
option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded
|
||||
|
||||
#librarian
|
||||
|
|
|
@ -10,7 +10,6 @@ section#twitter_page.option-block
|
|||
h4(data-localise="__MSG_redirectType__") Redirect Type
|
||||
select#twitter-redirect_type
|
||||
option(value="both" data-localise="__MSG_both__") both
|
||||
option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded
|
||||
option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded
|
||||
|
||||
#nitter
|
||||
|
|
|
@ -29,7 +29,6 @@ section#youtube_page.option-block
|
|||
h4(data-localise="__MSG_redirectType__") Redirect Type
|
||||
select#youtube-redirect_type
|
||||
option(value="both" data-localise="__MSG_both__") both
|
||||
option(value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__") Only Embedded
|
||||
option(value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded
|
||||
|
||||
#invidious
|
||||
|
|
Loading…
Reference in New Issue