Skip to content
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

Re-enable history api on file:// protocol #57504

Merged
merged 1 commit into from
Feb 7, 2019

Conversation

GuillaumeGomez
Copy link
Member

Fixes #57135.

I tested locally on chrome (since it was the browser having issues with history management on file:// protocol) and it worked fine so I guess we can re-enable it.

r? @QuietMisdreavus

@ecstatic-morse
Copy link
Contributor

ecstatic-morse commented Jan 10, 2019

Using history.pushState on a page loaded from file:// throws a SecurityError in Firefox 64, so I don't think you should unconditionally enable this.

As far as I can tell, it looks like history.pushState on a page loaded from file:// throws a SecurityError in Firefox 64 if the pages have different origin. Since opening the search window just adds a query parameter, the calls pushState should be fine for most modern browsers, but you might want to add a comment to this effect.

@steveklabnik
Copy link
Member

steveklabnik commented Jan 10, 2019 via email

@GuillaumeGomez
Copy link
Member Author

The problem was supposed to be only on chrome. My firefox worked correctly though.

@QuietMisdreavus
Copy link
Member

As far as I can tell, it looks like history.pushState on a page loaded from file:// throws a SecurityError in Firefox 64 if the pages have different origin. Since opening the search window just adds a query parameter, the calls pushState should be fine for most modern browsers, but you might want to add a comment to this effect.

This seems to make it okay? I think we only use the history API when loading up the search results, so it may work out.

@GuillaumeGomez
Copy link
Member Author

Normally yes.

@stokhos stokhos added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 14, 2019
@TimNN TimNN added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 22, 2019
@QuietMisdreavus
Copy link
Member

I double-checked main.js to make sure we only used the history API (or at least, only this detection) when modifying the query string or hash of the URL, and not the file. Because of that, i'm okay merging this.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 7, 2019

📌 Commit 830b3b8 has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 7, 2019
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 7, 2019
…=QuietMisdreavus

Re-enable history api on file:// protocol

Fixes rust-lang#57135.

I tested locally on chrome (since it was the browser having issues with history management on `file://` protocol) and it worked fine so I guess we can re-enable it.

r? @QuietMisdreavus
bors added a commit that referenced this pull request Feb 7, 2019
Rollup of 11 pull requests

Successful merges:

 - #57504 (Re-enable history api on file:// protocol)
 - #57848 (Generate a documentation page for core::mem::transmute.)
 - #57884 (Update minifier version)
 - #57954 (rustdoc: remove blank unstable spans)
 - #58028 (Fix image link in the settings menu)
 - #58033 (rustdoc: wrap stability tags in colored spans)
 - #58086 ([rustdoc] Improve file list display)
 - #58143 (Sort elements in the sidebar)
 - #58146 (Prevent automatic collapse of methods impl blocks)
 - #58150 (Don't apply impl block collapse rules to trait impls)
 - #58185 (Remove images' url to make it work even without internet connection)

Failed merges:

r? @ghost
@bors bors merged commit 830b3b8 into rust-lang:master Feb 7, 2019
@GuillaumeGomez GuillaumeGomez deleted the re-enable-history branch February 8, 2019 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants