Open in browser missing
I've imported my project into PyCharm but when I right click on an html file the "Open in browser" option doesn't show.
For different projects it does show on html files. How do I get that option back?
For different projects it does show on html files. How do I get that option back?
Please sign in to leave a comment.
Hi,
Thanks for your feedback.
It's the known issue https://youtrack.jetbrains.com/issue/PY-13986, please follow it for updates. See http://intellij-support.jetbrains.com/entries/23368682 if you are not familiar with YouTrack.
PyCharm team.
This is still an issue, 4 years later... all the menu options mentioned in the help pages about viewing an .html file in a browser are AWOL. The best workaround I can do is "View in Finder" and then double-click from there.
I had the same problem when I installed a new version of the program. Also in HTML files did not work Ctrl + / (comment line). The solution was looking for a long time in the settings but it was simple:
In settings - > editor - > file types - > HTML, in the list of registered patterns was not "*.html ", but it was in Stelve Html Components. I added"*.html " in HTML and everything worked.
Maybe this will help you.
Hi Cekcctac,
This is actually unusual that you had *.html assigned to a different file type. Did you make a fresh installation of PyCharm or updated?
I use Linux mint 18. I had installed version 2016. I installed the new version via Snap as stated in the installation instructions. take me worth the new and old version, old everything works And the new did not work.
Did you import settings from old one to new one?
I suspect there is some custom plugin causing the issue.
No, I didn’t import the old settings. What plugins didn’t set the plugin’s ses settings as standard. But for the sake of experiment, I imported the old settings, but this problem did not solve. I also suspected that some plug-in was installed and it interferes with normal operation, but I did not know how to define this plug-in.
Cekcctac,
THANK YOU for your info on this. I have had the same issue for a few months now and it's been driving me crazy. Everything worked completely fine with the open in browser and it showed the browser icon shortcuts when I hovered over html code, then it suddenly STOPPED working. The option to open in browsers just disappeared completely. It was driving me crazy.
I did exactly what you said, and yup my .html was somehow also assigned to Svelte Html Components. I don't know what that even is or how it happened. I hadn't made any changes to my system other than updating IntelliJ when it prompted me to.
Anyways, THANK YOU for providing the fix. I was ready to give up and move to a different IDE.
Forgot to add, I was using regular IntelliJ Ultimate, not PyCharm. This still fixed my issue. I hadn't installed any new plug-ins etc when the issue started.
I nice to help you) I understand you, I also installed the previous version because this option was very important to me. I hope the developers will fix this minor problem in our favorite program)
I had a same issue with a .html with a vue app inside.
Just Right Click on file, "Overide file types" and select "html"
This give back the "open in browser" !
Hope it helps
Hi, this problem later emerged with one of my projects (i.e. right click on an HTML file in project pane → Open In → … option “Browser” is missing …). I am using PyCharm Professional 2023.3.4. I tried the suggestions above and also to install a fresh copy of PyCharm (after deleting directories mentioned here https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs ). Nothing helped.
However, I noticed that when I create a fresh new project with an HTML file, the “open in browser” option is available. Therefore I decided to experiment a bit and I came with quite a simple example that make “open in browser” disappear - at least on my computer.
To reproduce the example, create an empty folder for the project and then create files in it as follows:
Then open that project directory as a project in PyCharm. In my case, “open in browser” does not show when I try to use it on
index.html.However, if you modify the above script with any of the following, “open in browser” will appear (to be sure, always delete
.ideadirectory after any modifications before you open the project in PyCharm):1. Don't add Flask-related line into
my_package/main.py(i.e. keep that file empty):2. Don't create
my_package/__init__.pyfile, i.e. don't run this command:3. Don't create
templatesfolder at all, or use a different name, e.g.my_templates. This might be related to the fact that PyCharm automatically markstemplatesdirectory as Template Folder.I also noticed with all these cases that when “open in browser” is missing, a Run configuration for
my_package/main.pyis automatically created.Btw, if I do one those three points above to make “open in browser” appear, but also add
requirements.txtfile with stringFlaskin it, “open in browser” disappears again.This problem is related to the new Django preview implementation and, unfortunately, affects Flask projects. Please vote for the related issue to raise its relevance: https://youtrack.jetbrains.com/issue/PY-65551/Web-browsers-and-HTML-preview-are-missing-when-template-language-is-set
Also, please leave a comment that it also affects Flask; it will help us estimate the issue's impact properly.