-
Notifications
You must be signed in to change notification settings - Fork 60
Resolve "null is not a valid URL" errors caused by a URL parsing bug in Firefox #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,7 +139,7 @@ async function updateMatchingPasswordsCount(tabId, forceRefresh = false) { | |
|
|
||
| try { | ||
| const tab = await chrome.tabs.get(tabId); | ||
| badgeCache.settings.origin = new URL(tab.url).origin; | ||
| badgeCache.settings.origin = tab.url && new BrowserpassURL(tab.url).origin; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like that we have to repeat this
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you suggesting that BrowserpassURL should accept
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it ever null? When I tested this,
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because that's not the only place we obtain a URL from. In some places we parse the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this specific invocation sometimes has
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's rethink it, how about we make |
||
| } catch (e) { | ||
| throw new Error(`Unable to determine domain of the tab with id ${tabId}`); | ||
| } | ||
|
|
@@ -590,7 +590,10 @@ async function getFullSettings() { | |
| let originInfo = new BrowserpassURL(settings.tab.url); | ||
| settings.host = originInfo.host; // TODO remove this after OTP extension is migrated | ||
| settings.origin = originInfo.origin; | ||
| } catch (e) {} | ||
| } catch (e) { | ||
| settings.host = null; | ||
| settings.origin = null; | ||
| } | ||
|
|
||
| return settings; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.