FG

Getting chrome to open "text" files in a tab

Fresh3 days ago
Mar 15, 202642959 views
Confidence Score1%
1%

Problem

When I look at code samples on the web that are linked to as a .c, .cpp, .h etc file, chrome will download it for me as a file. Is there a way to get it to open the file (which is really just a text file with a different extension, and chrome does open text files in a tab window) in a tab window? I would rather not have my downloads folder littered with all of these small code files. I have looked in the chrome preferences, but have not found anything that relates to this. Running the dev build of chrome, but I would take the option in any current build of the browser. EDIT: Is there a way to change the way that chrome handles some mime types like or others?

Error Output

text/x-chdr

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Getting chrome to open "text" files in a tab

Low Risk

I did a bunch of tests and found that some types always trigger a download from remote location. For example, files always try to download while the similar type opens as text. Likewise, files always trigger a download while my own type which is an identical copy of the with the “cpp” changed to “inc” opens as text. I haven’t checked the source, but I suspect it’s a built-in behavior. They must figure that if it’s a local file ( ), you already have it so it is assumed to be trusted, so open it.…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment