diff --git a/manifest.json b/manifest.json index 3eb91a46..ce845138 100644 --- a/manifest.json +++ b/manifest.json @@ -570,6 +570,17 @@ "scripts/community/agecheck.js" ] }, + { + "run_at": "document_start", + "matches": + [ + "https://steamcommunity.com/linkfilter/*" + ], + "js": + [ + "scripts/community/linkfilter.js" + ] + }, { "all_frames": true, "matches": diff --git a/scripts/community/linkfilter.js b/scripts/community/linkfilter.js new file mode 100644 index 00000000..0ec2fe3b --- /dev/null +++ b/scripts/community/linkfilter.js @@ -0,0 +1,21 @@ +'use strict'; + +GetOption( { 'enhancement-no-linkfilter': false }, ( items ) => +{ + if( items[ 'enhancement-no-linkfilter' ] ) + { + if( window.location && window.location.search ) + { + const params = new URLSearchParams( window.location.search ); + + if( params.has( 'u' ) ) + { + window.location.replace( params.get( 'u' ) ); + } + else if( params.has( 'url' ) ) + { + window.location.replace( params.get( 'url' ) ); + } + } + } +} );