You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

22. March 2012, 10:54:17

dranach

Posts: 5

xdg-open opens a new tab

I use freemind (a mind mapper), where I attach text files to nodes. Freemind is configured to open files and hyperlinks with xdg-open.
Every time I click on a link for a text file in freemind, my default application (Bluefish) opens up with the text file, but Opera opens each time a new tab as well. After some time opening up text files, Opera ends up with the same amount of blank pages, referencing "...".

The MIME Type "text/plain" in Opera is set to "Open with other application: xdg-open", which is also the handler for files.
I tried setting the MIME Type also to "Open with other application: bluefish", same thing, Opera opens a blank tab.

The same behaviour I discovered when clicking a link for a text file from a webpage. Bluefish starts up, opens the text file, but Opera opens up a new tab (about:blank) AND a new window (about:blank). When I close the new window, the tab closes as well.

Is it possible to change this behaviour and NOT open a blank page or blank window each time I open a link to a text file?

22. March 2012, 18:35:46

Moderator

sgunhouse

Volunteer

Posts: 64825

I gather that freemind itself is not a program, but rather some form of web app (or maybe I should say, is accessed through a web app) ... otherwise the question would be what settings in Opera would have to do with an external program.

It's not xdg-open which is opening the new tab (or if it is, then you should ask them and not Opera). And you don't want to generally set text files from the web to open a local program either. So hopefully you've been making these changes under "Handlers for saved files"?

22. March 2012, 18:59:24

dranach

Posts: 5

Freemind is not a web app, but it is written in java.
Anyway, it seems that it needs a webbrowser to open a text file, through xdg-open.

If I let Opera handle it, it shows the text file in a window.
If I choose for xdg-open, it opens the text file in its appropriate program (e.g. Bluefish), but also opens up a tab. Because it says "<location of the file>" in the address portion, my guess was that Opera treated this as a download, though I'm not absolutely sure.

When I used Firefox, it had the same behaviour, but I didn't have the possibility like I have in Opera to manually change the MIME Types. So I could only open a text file in a browser tab, without the possibility to edit. Even with Opera opening up a new tab, it is in any case a leap forward, as I can finally edit my text files. The extra tabs are somewhat of a setback, though.

BTW, the handlers for saved files are set to xdg-open, both for files and for folders.

It would be nice if a text file opened up without the extra work of closing a tab each time. If not.. well I could eventually live with that, I guess.

22. March 2012, 20:42:44

Frenzie

Posts: 14431

I'm confused, xdg-open opens up Bluefish as well as Opera? Then isn't that an issue with xdg-open?
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

22. March 2012, 21:38:27

dranach

Posts: 5

I guess it goes as follows:
1. click in freemind on the link with the local text file attached
2. xdg-open directs the click to the default browser, to do with it as it pleases
3. the default browser should open the default editor, through the MIME types.

This is how I always have understood it. I might be wrong, of course..

22. March 2012, 23:25:08

Moderator

sgunhouse

Volunteer

Posts: 64825

Say that you tell Opera that you want to open PDF files in Adobe Reader (rather than the plugin), then you click a link to a PDF file. Opera will open a tab for the file, but then it will realize the file is a PDF and send it to Adobe Reader - but it won't close the tab it opened before it realized what type of file you clicked on.

They have over the years made an effort to reduce the number of blank tabs you get like this, and so my PDF example might actually not open a tab now - it may be that Java is the issue in that sense. Java is telling the browser to open a new tab, then telling it to put this file in that tab.

23. March 2012, 07:51:02

dranach

Posts: 5

It may well be that java is the problem. In the meantime I have been experimenting with another mind mapping program (vym), which doesn't rely heavily on java. It features the same clickable links like freemind, but it doesn't need a webbrowser to open them up in the default editor.
It's a pain to convert all my maps to the new format, though, but that's another matter.

Thanks to all anyway for your input. Your feedback helped think things through..

Forums » Opera for Windows/Mac/Linux » Opera for *nix - Linux/FreeBSD