Skip to content

Fix "Not allowed to navigate top frame to data URL" #27

@Archangel1C

Description

@Archangel1C

Hello,
it seems, that Chrome has implemented a security feature that prevents to execute data URLs from JavaScript, which causes TabHibernation to not function anymore: if you try to hibernate a tab, the console shows a message like "Not allowed to navigate top frame to data URL: data: ...".

It seems, it is possible to use the src attribute of an <iframe>, though.
Maybe one could replace all the content with an <iframe> or use about:blank and add the <iframe> ? (just guessing; obviously, I'm not much into Extension programming, yet ^^).

From the feature proposal on Google Groups:

Alternative implementation suggestion for web developers
The main use case for navigating to data URLs in the top frame is generating files (HTML, PDF, images etc.) on the fly and displaying them to the user.

For that use case, these alternatives exist:

  • Generate the file on the backend and send it to the user over http/https.
  • Initiate a download instead of displaying the URL.
  • If the contents of the URL is trusted, iframe the URL so that the omnibox displays the site's URL.

Resources:
What does it mean
Intent to Deprecate and Remove: Top-frame navigations to data URLs
Related StackOverflow Question

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions