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

[Bug] When using Firefox as local file viewer and tabs from outside managed, TST prepends "about:blank?" to URL and breaks viewing #3410

Closed
raunn opened this issue Nov 19, 2023 · 6 comments

Comments

@raunn
Copy link

raunn commented Nov 19, 2023

Abstract

When using Firefox as a local file viewer (e.g. for PDFs) and TST is set to manage new tabs from outside Firefox, the URL will be modified after the management event, and "about:blank?" will be prepended. This breaks viewing, and a blank page is shown.

For example, if the user has their system set to open PDF with Firefox, and then opens a PDF in the system, normally (unmanaged) a new tab will appear with a URL like "file:///C:/Users/Path/To/File.pdf" . If TST is installed and set to manage those new tabs (which is the default setting) then the tab will open correctly and then get moved immediately to the managed tree location and container, and the URL will be changed to "about:blank?file:///C:/Users/Path/To/File.pdf" and it will fail to display the file. The URL must be manually edited in the resulting tab to remove the prepend before the file can be viewed.

Steps to reproduce

  1. Start Firefox with clean profile.
  2. Install TST.
  3. Set system to open PDF files with Firefox.
  4. Open Firefox and start a new tab in any container.
  5. Open a PDF file from the system filesystem (e.g. by double-clicking on the file in Windows File Explorer )

To demonstrate non-managed behavior, set:
New Tabs Not From Existing Tabs -> Non-Blank New Tabs -> New Tab From Outside Firefox
to
"Open as (no control)"
and repeat steps 4-5.

Expected result

Tab is opened in correct tree position and container, URL remains "file:///...", and Firefox displays the file correctly

Actual result

Tab is opened in correct tree position and container, but URL is prepended with "about:blank?" and Firefox cannot display the file

Environment

  • Platform (OS): Windows 11
  • Version of Firefox: 119.0.1
  • Version (or revision) of Tree Style Tab: 3.9.18
@piroor
Copy link
Owner

piroor commented Nov 19, 2023

This is due to the restriction of WebExtensions API: it does not allow addons to reopen tab with file: URL with different container.
See TST options => "New Tabs not from Existing Tabs" => "Non-blank new tabs" and choose "(no control)" for all "Container:" options, then TST never tries to reopen file: URL tabs on your case.

Here is a solution idea: disabling the feature "reopen tab with different container" for some type URLs , to avoid such a "about:blank?" prefixed URL tabs problems. How about this idea?

@piroor piroor added Firefox-issue bug of Firefox itself has-workaround and removed needs-triage labels Nov 19, 2023
@raunn
Copy link
Author

raunn commented Nov 19, 2023 via email

@piroor
Copy link
Owner

piroor commented Nov 20, 2023

I've introduced a change 4ad0b62, now TST won't reopen un-reopenable URL tabs for cases like this.

@raunn
Copy link
Author

raunn commented Nov 20, 2023 via email

@irvinm
Copy link
Contributor

irvinm commented Nov 9, 2024

@piroor should this one be closed?

@piroor
Copy link
Owner

piroor commented Nov 12, 2024

Related topic: now TST supports drag-and-drop of local files to its vertical tab bar. It is based on blob: URI which is generated from dataTransfer which is a part of drag events. File: URL tabs looks to be reopened with blob: URI but actually it is impossible because there is no genuine method to generate dataTransfer from file: URL tabs. Moreover, calling of fetch() for file: URL is not allowed for addons.

I hope to keep this issues tracker as the place to track unresolved problems possible resolved, so I close this for now.

@piroor piroor closed this as completed Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants