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) {
156156}
157157async function fetchByPassOrigin ( url , options = { } ) {
158158 try {
159- let _url = url ;
160- let urlObject = new URL ( url ) ;
159+ let _url = makeUrlValid ( url ) ;
160+ let urlObject = new URL ( _url ) ;
161161 // https://stackoverflow.com/a/9375786/23648002
162162 if ( location . hostname == urlObject ?. hostname ) {
163163 _url = urlObject . pathname ;
@@ -925,6 +925,9 @@ function makeUrlValid(url) {
925925 if ( url . startsWith ( "//" ) ) {
926926 url = "https:" + url ;
927927 }
928+ if ( url . startsWith ( "/" ) ) {
929+ url = location . origin + url ;
930+ }
928931 return url ;
929932}
930933function getWatchingVideoSrc ( ) {
@@ -1299,6 +1302,7 @@ async function getLargestImageSrc(imgSrc, webUrl) {
12991302 }
13001303
13011304 // bypass redirect
1305+ imgSrc = makeUrlValid ( imgSrc ) ;
13021306 let redirectedUrl = await getRedirectedUrl ( imgSrc ) ;
13031307 if ( redirectedUrl ) {
13041308 imgSrc = redirectedUrl ;
You can’t perform that action at this time.
0 commit comments