File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -207,18 +207,13 @@ function onBeforeRequest(details) {
207207 }
208208 }
209209
210- // TODO: Clean this silliness
211- var finaluri = null ;
212- if ( newuristr ) {
213- finaluri = document . createElement ( 'a' ) ;
214- finaluri . href = newuristr ;
215- }
216-
217210 if ( newuristr && using_credentials_in_url ) {
218211 // re-insert userpass info which was stripped temporarily
219- finaluri . username = tmp_user ;
220- finaluri . password = tmp_pass ;
221- newuristr = finaluri . href ;
212+ var uri_with_credentials = document . createElement ( 'a' ) ;
213+ uri_with_credentials . href = newuristr ;
214+ uri_with_credentials . username = tmp_user ;
215+ uri_with_credentials . password = tmp_pass ;
216+ newuristr = uri_with_credentials . href ;
222217 }
223218
224219 // In Switch Planner Mode, record any non-rewriteable
@@ -232,7 +227,7 @@ function onBeforeRequest(details) {
232227 }
233228
234229 if ( httpNowhereOn ) {
235- if ( finaluri && finaluri . protocol === "http:" ) {
230+ if ( newuristr && newuristr . substring ( 0 , 5 ) === "http:" ) {
236231 // Abort early if we're about to redirect to HTTP in HTTP Nowhere mode
237232 return { cancel : true } ;
238233 }
You can’t perform that action at this time.
0 commit comments