newtabhomepage
newtabhomepage copied to clipboard
Start page not displayed when using a local html file
Running Firefox 57.0b11 (64-bit) on Linux Manjaro. Start page is not displayed when opening a new tab if a local html file is used as start page.
Can you give an example of the location of the file? I had to specifically support this on Windows and I guess I'll have to do something extra for Linux also.
In the URL bar, as well as in the preferences bar for start page, the file search path would be given on the form of: "file:///home/USER/git/tilde/index.html" The corresponding file path on the OS would be: "/home/USER/git/tilde/index.html" Where USER corresponds to a user on the system.
However, I remembered that this used to work just a couple of weeks ago while I was running Arch linux on a different computer, this was however done using an older version of firefox (not-quantum beta). So the issue may be on my side if it doesn't have anything to do with the rewrite using WebExtensions API, or running firefox quantum beta. Also, thanks for an awesome extension =)
It definitely is related to my port to WebExtensions, as the old set of APIs used to just handle this kind of thing fine without any special code on my side, but it shouldn't be too hard to sort it out. Thanks for the details, I'll look into it.
Same thing here, on Debian. My setup also worked pre-57.
The URL bar claims the page was loaded by the extension, so it's at least getting to that point.
Same problem ( but i'm on windows )
Same issue on macos:
Although when a new window is opened (
cmd+n
), it does work.
Partial dump from about:support
:
Application Basics
------------------
Name: Firefox
Version: 57.0
Build ID: 20171112125346
Update Channel: release
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0
OS: Darwin 17.2.0
Multiprocess Windows: 3/3 (Enabled by default)
Web Content Processes: 5/4
Stylo: true (enabled by default)
Google Key: Found
Mozilla Location Service Key: Found
Safe Mode: false
Firefox Features
----------------
Name: Activity Stream
Version: 2017.11.07.1100-7f4e3634
ID: [email protected]
Name: Application Update Service Helper
Version: 2.0
ID: [email protected]
Name: Disable Media WMF NV12 format
Version: 1.1
ID: [email protected]
Name: Firefox Screenshots
Version: 19.2.0
ID: [email protected]
Name: Follow-on Search Telemetry
Version: 0.9.6
ID: [email protected]
Name: Form Autofill
Version: 1.0
ID: [email protected]
Name: Multi-process staged rollout
Version: 3.05
ID: [email protected]
Name: Photon onboarding
Version: 1.0
ID: [email protected]
Name: Pocket
Version: 1.0.5
ID: [email protected]
Name: Shield Recipe Client
Version: 76.1
ID: [email protected]
Name: Web Compat
Version: 1.1
ID: [email protected]
Extensions
----------
Name: New Tab Homepage
Version: 0.6.2
Enabled: true
ID: {66E978CD-981F-47DF-AC42-E3CF417C1467}
Name: uBlock Origin
Version: 1.14.18
Enabled: true
ID: [email protected]
Name: Simplified Tab Groups
Version: 0.5.1
Enabled: false
ID: [email protected]
Windows users: if you simply set your homepage to "C:\path\to\file.html" or similar, everything works fine (e.g. just a normal Windows path, backslashes, do not prefix with "file:///".
I will try to shore up support for the other variations (who knows what will be possible in Firefox 57+), but if you're looking for a workaround, I've just tested it and it works for me with Firefox 57 and 0.6.2.
Except that Firefox won't open "C:\path\to\file.html" for me. I've tried moving the file to different locations and it just will not work.
What I get is:
The address wasn’t understood
Firefox doesn’t know how to open this address, because one of the following protocols (e) isn’t associated with any program or is not allowed in this context.
You might need to install other software to open this address.
Not sure what to tell you. It works for me, both via New Tab Homepage and also the Home button.
I can get the same error as you if I use forward slashes. You have to use backslashes to make this work.
Thank you. It works if I use back slashes. It will not work if the file is in the Documents folder but I moved it to the root of C: and it works. I will try some other locations and see if they work there as well, but I can live with it if I have to keep it there.
Thank you for your hard work.
I'm doing a bit more research (had to fire up a terrible laptop to try out different permutations on Linux, because I rarely if ever use Linux) and will shortly file a bug with Mozilla to try and get this supported properly in the tab APIs.
Ok, it does work in the Documents folder. What the problem I had with that folder is that it will not work if %20 is used instead of a space in the address. By default, Firefox adds a %20 instead of a space when you pick Current Page as your Home page if the Current Page is a file with a space in the name or the folder name.
Thanks, that's good to know. If it's possible to put in an ugly-but-functional workaround, I'll need to include that as well.
If any Linux folk are eagerly awaiting an answer, I would recommend playing around yourselves. Try removing "file:///" and see what happens? I suspect it won't work because Linux file system paths look too much like relative URLs and Firefox will probably assume that's what they are. In the mean time I'll be reinstalling my distro.
Filed bug 1421102 for Mozilla's consideration. Expecting a WONTFIX, because of some nonsense security concerns, even though you can do this in other parts of the UI (and seemingly on Windows either way). If that happens I will attempt to challenge it, but I've never had a WONTFIX undone ever.
My Linux is hosed and needs to be completely reinstalled from scratch. I will try to figure out if there's a workaround or other solution another day because it looks like it'll take hours to have a working install again.
Well, that got closed and shouted down in record time. Bad news, the functionality you're all using is considered a security hole, which I assume will be plugged. Unfortunately you'll have to move your homepages to a non-local URL to be compatible.
I will update the add-on so that instead of a blank page, it shows something useful (e.g. a warning about this problem and what to do about it).
Strange ... When I use a local file as my homepage it is displayed in an orderly way when starting FF. So that is considered to be save? And if I want to use the same local file when requesting a new tab it is considered to be an security hole? Strange …
Thanks for your work ! Same on Debian stable with firefox 57. Homepage OK, newtab security hole ??? WTF
The security problem is that (for various reasons), Mozilla do not want add-ons to have access to files on the local disk.
The concern is that if my add-on can create a tab, it could screenshot the tab or otherwise read information from the file. This isn't a problem when it's your homepage file, but could be contentious considering it could (in theory) be extended to read any file on disk.
The entire problem can be fixed if they would just allow a new tab to open your Home page. If something is opened as your Home page, why would it be a problem to open it in a new tab? This baffles me as to why they don't have this. How could a new tab be a problem when the first time you open Firefox it isn't?
It's not the concept of it opening in a new tab that is the problem, the problem is that it is add-on code doing the work, not in-built Firefox code that is trusted.
And for the record, yes, I agree. I created this add-on in 2005 with the expectation that it would be folded into core browser functionality at some point. Still waiting, 12 years later, despite every other browser having this built in.
Is it possible after opening a new tab, just to simulate a click on homepage button ?
As far as I know that is not possible.
Mac User: Same problem when I upgraded to FF 57
Ugly Workaround: Middle mouse click on the home button opens a new tab with the home page (Cmd-click for Macs). Less convenient that Ctrl-T or Cmd-T.
@benbasson, thanks for the addon, tell me is anything else can be done to contact mozilla to help with this issue. If Mozilla tries to have a superior browser they fail by having less functionality (i.e. missing "new tab homepage even if it's a file") than other browsers.
In my experience, once something is shouted down on Bugzilla, you can forget about it.
If you all want to complain to Mozilla, be my guest:
- https://www.mozilla.org/en-US/firefox/feedback/
- https://twitter.com/mozilla
- https://twitter.com/firefox
The best thing they could do is just build the functionality into the browser and make this add-on unnecessary, but I've never seen any appetite for that so far.
Same problem for me on Ubuntu 18.04 LTS. Is there any temporary solution ?
You can use autoconfig to achieve this. Follow the instructions there and then put the following in firefox.cfg:
var {classes:Cc,interfaces:Ci,utils:Cu} = Components; try { var newTabURL = "file://path-to-local-file"; aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"].getService(Ci.nsIAboutNewTabService); aboutNewTabService.newTabURL = newTabURL; } catch(e){Cu.reportError(e);} // report errors in the Browser Console
This was originally taken from a post by someone at mozilla some time ago. It should still be online somewhere, but I don't remember where...
I'm not doing any active development on this add-on - sorry, the Firefox APIs sucked at the time I had to update this, and I suspect they're no better now (no interest has been shown in accommodating this type of add-on or functionality).
See answer above and/or https://bugzilla.mozilla.org/show_bug.cgi?id=1421102