Update OpenSteamLinksInApp.plugin.js

This commit is contained in:
Mirco Wittrien 2021-08-24 14:54:42 +02:00
parent f5bd519d36
commit c1318a1dde
1 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name OpenSteamLinksInApp * @name OpenSteamLinksInApp
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.1.3 * @version 1.1.4
* @description Opens Steam Links in Steam instead of your Browser * @description Opens Steam Links in Steam instead of your Browser
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,12 +17,12 @@ module.exports = (_ => {
"info": { "info": {
"name": "OpenSteamLinksInApp", "name": "OpenSteamLinksInApp",
"author": "DevilBro", "author": "DevilBro",
"version": "1.1.3", "version": "1.1.4",
"description": "Opens Steam Links in Steam instead of your Browser" "description": "Opens Steam Links in Steam instead of your Browser"
}, },
"changeLog": { "changeLog": {
"fixed": { "fixed": {
"HTTP Links": "Also works with http links and not only with https links" "Zoomable Images": "No longer tries to open zoomable Images inside Steam"
} }
} }
}; };
@ -81,7 +81,9 @@ module.exports = (_ => {
onLoad () {} onLoad () {}
onStart () { onStart () {
for (let key in urls) BDFDB.ListenerUtils.add(this, document, "click", BDFDB.ArrayUtils.removeCopies(urls[key].map(url => url.indexOf("http") == 0 ? (url.indexOf("https://") == 0 ? [`a[href^="${url}"]`, `a[href^="${url.replace(/https:\/\//i, "http://")}"]`] : `a[href^="${url}"]`) : `a[href*="${url}"][href*="${key}"]`).flat(10).filter(n => n)).join(", "), e => this.openIn(e, key, e.currentTarget.href)); for (let key in urls) BDFDB.ListenerUtils.add(this, document, "click", BDFDB.ArrayUtils.removeCopies(urls[key].map(url => url.indexOf("http") == 0 ? (url.indexOf("https://") == 0 ? [`a[href^="${url}"]`, `a[href^="${url.replace(/https:\/\//i, "http://")}"]`] : `a[href^="${url}"]`) : `a[href*="${url}"][href*="${key}"]`).flat(10).filter(n => n)).join(", "), e => {
if (!(e.currentTarget.className && e.currentTarget.className.indexOf(BDFDB.disCN.imagezoom) > -1)) this.openIn(e, key, e.currentTarget.href);
});
} }
onStop () {} onStop () {}