Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfix 'about:blank' being displayed permanently on new tabs #8880
Conversation
|
this is a good workaround for now, but I want to capture the two underlying problems:
|
| @@ -89,6 +91,18 @@ describe('tab tests', function () { | |||
| .waitForExist('[data-test-id="tab"][data-frame-key="2"]') | |||
| .waitForTextValue('[data-test-id="tab"][data-frame-key="2"]', 'New Tab') | |||
| }) | |||
|
|
|||
| it('shows empty urlbar', function * () { | |||
This comment has been minimized.
This comment has been minimized.
bridiver
May 16, 2017
Collaborator
both of these tests pass even when I remove the urlbar changes so I'm not sure if they really capture the issue
This comment has been minimized.
This comment has been minimized.
diracdeltas
May 16, 2017
Author
Member
they failed for me but maybe i was on a slightly older commit
| if (this.props.activeFrameKey !== prevProps.activeFrameKey) { | ||
| this.keyPressed = false | ||
| // The user just changed tabs | ||
| this.setValue(this.props.locationValue) | ||
| this.setValue(this.props.locationValue !== 'about:blank' |
This comment has been minimized.
This comment has been minimized.
bridiver
May 16, 2017
Collaborator
going to merge this as a workaround for now, but we want to get away from putting this kind of logic in components. The same workaround could be done in a reducer to update the urlbar location on tab change
| this.setValue(this.props.locationValue) | ||
| this.setValue(this.props.locationValue !== 'about:blank' | ||
| ? this.props.locationValue | ||
| : UrlUtil.getDisplayLocation(this.props.location, pdfjsEnabled)) |
This comment has been minimized.
This comment has been minimized.
bbondy
May 16, 2017
Member
I don't understand what this does.
Only in the case thatthis.props.locationValue is about:blank does it go to UrlUtil.getDisplayLocation(this.props.location, pdfjsEnabled)) and UrlUtil.getDisplayLocation('about:blank', pdfjsEnabled)) actually returns about:blank.
This comment has been minimized.
This comment has been minimized.
bbondy
May 16, 2017
•
Member
Since this doesn't do anything, I'm changing this to:
- this.setValue(this.props.locationValue !== 'about:blank'
- ? this.props.locationValue
- : UrlUtil.getDisplayLocation(this.props.location, pdfjsEnabled))
+ if (this.props.locationValue !== 'about:blank') {
+ this.setValue(this.props.locationValue)
+ }
which I think is the expected functionality.
This comment has been minimized.
This comment has been minimized.
bbondy
May 16, 2017
Member
I think in the timing I'm experiencing the change does nothing, but on the timing you're experiencing it does something. Trying to think of the right thing to do here.
This comment has been minimized.
This comment has been minimized.
bbondy
May 16, 2017
Member
This is also the line of code that causes typing fast after new tab to get clobbered by the way. Very noticeable if you have lots of bookmarks.
This comment has been minimized.
This comment has been minimized.
diracdeltas
May 16, 2017
Author
Member
@bbondy the issue was that when i opened a new tab, this.props.locationValue is about:blank (and wouldn't change unless i typed in the urlbar) but this.props.location is about:newtab. So previously, when i opened a new tab, it would show about:blank forever. this seemed to only happen to some users, as noted in the original issue.
It seems like your change would cause the issue to re-appear.
This comment has been minimized.
This comment has been minimized.
diracdeltas
May 16, 2017
Author
Member
my understanding was that we should always be showing getDisplayLocation(this.props.location) unless the user is modifying the urlbar. That would be the case here if the user switched to a tab where they had been modifying the urlbar, but not when opening a new tab.
diracdeltas commentedMay 16, 2017
•
edited
fix #8850
Test Plan:
Submitter Checklist:
git rebase -ito squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests