IntelliJ/PyCharm - where do I change what happens when I double click a file? - intellij-idea

I want PyCharm (IntelliJ) to display HTML-files in a browser, not open them in an editor, when I double click them in the project browser. Googling for a solution didn't return anything useful. Is this possible? How?
(This request also applies to PNG and some other filetypes but HTML is my main need at the moment)

Both IDEA and PyCharm are editors, and they will default to editing; that is, they will open the HTML file and allow you to edit it instead of displaying any kind of web page.
If you want to see the rendered HTML, you can hover to the top right corner and select one of the browsers recognized by IntelliJ and installed on your system to open it in a browser then. Be aware that this may not render things correctly if you rely on a language-specific functionality (like JSP, Jinja2 templates or Less) to generate code on your behalf.

Related

Is there any way to display in-line PDFs in Firefox?

Quick description - My company has a webpage that we use for responding to emails and assigning them to people (team inbox basically). The page converts all attachments (that it can) to .pdf files and each attachment/page gets converted as it's own separate .pdf so we can navigate the pages easier (I guess? At least there's a way to merge them into one file, but that opens in a new tab). These .pdf files are displayed in-line. Currently I have to use another browser for this page, due to Firefox not supporting in-line PDFs. Can anyone please advise if they have found a way to view in-line .pdfs within Firefox? Thanks in advance.
See these pics for reference -
In-line .PDFs displaying in Edge (Chromium)
Firefox not displaying
Firefox actually supports embedding PDFs in <iframe>. So this might be a problem with how this web app is written.
This example page shows it working in Firefox: https://www.w3docs.com/tools/code-editor/1077

Edit texts in a PDF on Chrome using Chrome inspect

Is there any way to modify texts in PDF on Chrome using the Chrome inspect tool? I was stuck because in the Chrome inspect element, differently than any other websites and even PowerPoint presentations opened in Chrome, I'm able to modify texts, while with PDFs I cannot. Does anyone know how to do it?
Edit: Yes I know that the changes made through Chrome DevTools are temporary, but usually I'm able to make those changes, even if they're temporary. But with PDFs I can't.
There are differences in the way some browsers handle PDF data.
Chromium based browsers are more traditional in that the PDF plug-in is based on a Foxit/Skia collaboration, So you need to understand in that case, the downloaded PDF you are viewing is in the binary application/pdf (file already outside of the html wrapper).
Just as you cannot edit the PDF text in Acrobat Reader, the most you can do is incrementally add comments/annotation or field data to the end of the file, before save as a secondary download. The server cannot see your changes unless you submit as an upload.
With Firefox and Google docs there is often a different approach where the PDF is "Repr"oduced as an "Ex"ample (A ReprEx of the PDF) so it is built of a hybrid image and text overlay to emulate that part of the real PDF source. When you previously or later save the underlying downloaded PDF (for viewing) it would not necessarily include any browser based HTML editing, in the saving.
There are other techniques for other cases, but to answer the basic OP question most simply, the answer is NO you cannot change a PDF body, only add notes, etc via extensions. Microsoft variant of Chrome I.E. Edge has some inbuilt annotation ability thus does not need a second extension.
Found this question because I was googling a similar situation--I was wanting to manipulate type sizes and margins on a PDF in inspector via Chrome. I found that FireFox DevTools will allow you to view those styles and even alter the content in the PDF while in browser. I am late to the game but hope this provides answers for someone else in the future.

Disable PDF printing in Firefox by web developer

I am developing a web page to show PDF (in .NET platform). The PDF is inside a iframe. One of the requirement is NOT allow client to print the PDF. I have already made the PDF to be password protected (with pdfsharp). I further hide the toolbar by setting toolbar=0. In Chrome & IE, this works fine. But for Firefox, the story is totally different.
In Firefox, the toolbar will be shown even append #toolbar=0 in the src link. Further, the password protected pdf can be printed by simply clicking the icon in the toolbar.
Can anyone suggest some ways to disable pdf printing in firefox.
Note: I need to show the PDF in the webpage. So, download the PDF is not a option.
You will not be able to control the toolbar or the ability to print (not all PDF viewers respect the permissions set by the password) if you rely on the native browser or OS level PDF viewer by using an iFrame. Different browsers will interpret those settings differently. Even different applications within the same browser will yield different results (Chrome vs Dropbox in Chrome)
You'll need to display the PDF using something like PDF.js or another such library if you want any kind of consistency in appearance and behavior.

Changing/customizing Safari's Web Inspector font

Is there a way to customize the font size of Safari's Web Inspector? I found these links on the web and have tried them out but don't seem to work:
https://gist.github.com/vlazar/1549785
http://miekd.com/articles/adding-some-monospace-to-the-safari-web-inspector/
If there's no solution to this problem, I might switch back to Chrome, for they offer even just a zooming feature for their own Web Inspector. Safari's Web Inspector fonts are just too small for me and my eyes suffer because of that.
I'd be happy to hear about workarounds or solutions anyone might have.
At the time this question was asked, it was not easy to change the zoom level.
In recent versions of WebKit, It's now possible to zoom the Web Inspector interface using ⌘– and ⌘+. This should be available in all versions of Safari Technology Preview.
It is not possible to change the font face through the user interface, though alternate font faces are used in various localizations.
Although it is very old question, I want to share much simpler alternative.
Open web inspector
Open settings of web inspector
Go to 'General' tab
Here you will see 'Zoom' option. Change it to a value you feel comfortable and all the text including UI buttons are enlarged.
The articles you linked refer to an earlier version of Safari. For version 6, the CSS is in a different location, depending on your OS version.
For 10.7.x:
/System/Library/StagedFrameworks/Safari/WebInspector.framework/Versions/Current/Resources/Main.css
For 10.8.x:
/System/Library/PrivateFrameworks/WebInspector.framework/Versions/Current/Resources/Main.css
You will need to chmod the file to edit it (back it up first) and it is compressed so using a tool that can prettify CSS is a good idea (I used WebStorm).
That's as far as I've got, I haven't identified the main content area font size class within the file yet. I'll let you know if I do (or maybe someone else will chime in).
I ended up doing a search/replace in the Main.css for 'font-size:11px' up to 14px.

Is it possible to configure OpenERP or my browser to open PDFs automatically?

Every OpenERP web report ask me if I want to keep the PDF. Of course I must keep it to view it. I end up with lots of PDF files that I have to clean up. I would like to configure OpenERP or my browser to automatically create and manage the temp PDF files.
My research shows me great confusion in the industry about security flaws in PDF files causing browser plugins that profess to being "PDF Viewers" to come and go. I have yet to find any method, procedure, plugin, add-on or magic incantation that views PDFs without me managing the file.
If you are using firefox and linux , why not open firefox & go to
Edit -> preferences -> applications ->
search for 'pdf' and in Action field select 'use(default)'.
This way the pdf will be stored in '/tmp' folder & opened from there.
You won't have to bother about managing it.
It is not possible in a clean way, you need a module that modifies the behaviour of openerp reports to be inline. There are two options:
https://github.com/buke/openerp-web-pdf-preview-print - I think this
is the best option as it works all the time, the caveat is it
launches a separated window like a popup (then you require to accept
popups).
https://www.openerp.com/apps/web_pdf_viewer - This is amazing as it
shows the pdf in the work area of openerp (no need to open a new tab
or a new window) but at the moment doesn't work at all times,some
reports are just downloaded instead of displayed (I dunno why).
BR
Andres Calle
www.trescloud.com