Skip to content
This repository has been archived by the owner. It is now read-only.

fix 'about:blank' being displayed permanently on new tabs #8880

Merged
merged 1 commit into from May 16, 2017
Merged

Conversation

@diracdeltas
Copy link
Member

diracdeltas commented May 16, 2017

fix #8850

Test Plan:

  1. open several new tabs. they should all show blank in the urlbar instead of about:blank after a short lag.
  2. 'new tab button' and 'new tab signal' tests should pass.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header
@diracdeltas diracdeltas added this to the 0.15.300 milestone May 16, 2017
@diracdeltas diracdeltas self-assigned this May 16, 2017
@diracdeltas diracdeltas requested review from bbondy and bsclifton May 16, 2017
fix #8850

Test Plan:
1. open several new tabs. they should all show blank in the urlbar instead of about:blank after a short lag.
2. 'new tab button' and 'new tab signal' tests should pass.
@bridiver
Copy link
Collaborator

bridiver commented May 16, 2017

this is a good workaround for now, but I want to capture the two underlying problems:

  1. We update the urlbar location for the activeFrame only even though each frame has its own urlbar in the state. The urlbar should track location updates regardless of whether it is visible or not
  2. We are updating the location too late on navigation. It should be updated when the provisional load succeeds, but we don't update it until the navigation completes
@@ -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.

Copy link
@bridiver

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.

Copy link
@diracdeltas

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.

Copy link
@bridiver

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

@bridiver bridiver merged commit 20c5ce6 into master May 16, 2017
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@bsclifton bsclifton deleted the fix/8850 branch May 16, 2017
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.

Copy link
@bbondy

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.

Copy link
@bbondy

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.

Copy link
@bbondy

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.

Copy link
@bbondy

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.

Copy link
@diracdeltas

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.

Copy link
@diracdeltas

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.