File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,8 @@ function runInBackground(fnPath, params) {
156
156
}
157
157
async function fetchByPassOrigin ( url , options = { } ) {
158
158
try {
159
- let _url = url ;
160
- let urlObject = new URL ( url ) ;
159
+ let _url = makeUrlValid ( url ) ;
160
+ let urlObject = new URL ( _url ) ;
161
161
// https://stackoverflow.com/a/9375786/23648002
162
162
if ( location . hostname == urlObject ?. hostname ) {
163
163
_url = urlObject . pathname ;
@@ -925,6 +925,9 @@ function makeUrlValid(url) {
925
925
if ( url . startsWith ( "//" ) ) {
926
926
url = "https:" + url ;
927
927
}
928
+ if ( url . startsWith ( "/" ) ) {
929
+ url = location . origin + url ;
930
+ }
928
931
return url ;
929
932
}
930
933
function getWatchingVideoSrc ( ) {
@@ -1299,6 +1302,7 @@ async function getLargestImageSrc(imgSrc, webUrl) {
1299
1302
}
1300
1303
1301
1304
// bypass redirect
1305
+ imgSrc = makeUrlValid ( imgSrc ) ;
1302
1306
let redirectedUrl = await getRedirectedUrl ( imgSrc ) ;
1303
1307
if ( redirectedUrl ) {
1304
1308
imgSrc = redirectedUrl ;
You can’t perform that action at this time.
0 commit comments