Chrome does not open text files

Hi everyone,
I've been using Zorin for a few days. I've always used Windows, and I'm trying to learn.

My problem is simple: on Windows, I could open an .srt text file by dragging it into the Chrome browser, simply to translate it into my language and copy it to another text file.
When I try on Zorin, it tells me the file doesn't exist (ERR_FILE_NOT_FOUND).
How can I fix this? Is there an easy way to translate subtitles? I tried downloading an app called Buzz, but it won't open it. This type of solution was very convenient for me, and I'd like to have it on Zorin too.

(the only thing I changed is to put Zorin Desktop on Xorg because when I opened brave or chrome the system crashed)

How did you install Chrome?
If it is a snap or Flatpak, it is sandboxed (Well, double sandboxed, really) so it cannot parse a full file path, as it lacks access to the system.

EDIT:
Also - if you choose "Open With" and navigate to the path of the .srt file - does that work?

It's in flatpak mode. If I open the file with Open with Chrome, Chrome opens in a "Save As" window.

Are you willing to try a non-Flatpak package?

You might have luck using Flatseal on the Flatpak package to give more broad file access.

I cannot guide with details on how Flatseal works. For me, Flatpak and it's isolated nature deprives it of purpose; I never use the alternative Flatpak package system and stick to the Standard APT and .deb packages

I'll try.
Do you know an app for translating text files?

I do not have experience with any. But as it is not an uncommon issue, I suspect we can get you fixed up, even if along the way, you learn a new thing.

But I think that using the .deb package should work the same as it does on Windows OS.
You can remove the flatpak Chrome in the Software Store.
Using terminal run:

sudo apt install google-chrome-stable

1 Like

Unfortunately, even with the .deb version the same problem remains: instead of opening the text file it opens a page to save the file...

In that folder, choose a named .srt file and open terminal in that directory. Replace EXAMPLE ti that name of the .srt file you chose - relay the output of

xdg-mime query filetype EXAMPLE.srt

Is there a specific reason to open in Chrome and not use a text editor? ref: https://askubuntu.com/questions/428355/how-to-open-srt-files-in-ubuntu

Sorry, I'm new to Linux. I did what you asked, and then what should I do?

Paste the output here.
I am just looking for what mimetype association is assigned to .srt files. If it is not text/plain, then we know why it is being opened as something other than text.
Right click for Copy and Paste work in the terminal.

application/x-subrip

is that what you asked me?

1 Like

Bingo, that is it.
You can copy and paste each of the below to reassign the mimetype:

xdg-mime default org.gnome.gedit.desktop application/x-subrip

sudo sed -i 's|<mime-type type="application/x-subrip">|<mime-type type="text/plain">|' /usr/share/mime/packages/freedesktop.org.xml

After running each of those, run:

sudo update-mime-database /usr/share/mime

1 Like

Thank you so much. I'll try later because I can't right now :slight_smile:

1 Like

It works! You're great, man! Thanks so much again!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.