Google Chrome is not opening local HTML files when I double click to open them - html

I must have done something to Google Chrome on my Windows.
Local HTML files, even though they are associated with Chrome, do not actually open in Chrome anymore when I double click them. For example, double clicking an HTML file on my desktop will launch Chrome, but the browser window will not display the content of the HTML file.
If I change the program my computer will use to display HTML files to Safari or Firefox, they open as I expect them to, rendering the HTML properly in a browser window.
If, I have a Chrome window open and drag the HTML file into the browser window, it will render the HTML content properly, but the double clicking is the behavior I'm hoping to get back.
Does anyone know why this might have caused this change in Chrome behavior? And best of all, how to fix it?

Related

How to automatically take screenshots of local files loaded in Chrome browser?

I have a bunch of tabs opened with index.html files in my Chrome Browser.
I want to be able to take screenshots of all these opened pages automatically.
The Chrome Browser built-in screenshot functionality doesn't work with local files.
What's the best way to bulk take screenshots? (It needs to be in Chrome Browser)
And I need screenshots of just the visible part (above the fold), not the whole page.

Embedded PDF Issue in Edge Browser

When using the Microsoft Edge browser, by default when you open a PDF it will open the PDF in a new tab using the built-in PDF viewer. To avoid this, you can adjust the browser's settings: Toggle on the "Always open PDF files externally" option. This works great. However, it presents a separate issue. Our internal applications use embedded PDFs in iframes. When the external toggle is set to on, these PDFs will not show in the iframes. This doesn't happen in Chrome. Has anyone else experienced this and know a work around?
I've tried removing the type="application/pdf" from the iframe tag to no avail. I can't find anything else online.
It looks like an expected result because you have enabled the option Always open PDF files externally.
So MS Edge browser is giving you an option to download the PDF file and open it using the desired app.
You said this doesn't happen in Chrome browser.
If you enabled the Download PDF files instead of automatically opening them in Chrome option then you will notice the same result in the Chrome browser.
Output in the Chrome browser:
If you click on the Open button then it will download the PDF file.
I did not get any solution or a workaround for this issue.
If you think that there should be an option to load the file in an iframe if Always open PDF files externally option is enabled then I suggest you click on the Send Feedback button in the MS Edge browser and try to provide your feedback about it to the Microsoft.
I posted feedback suggesting that an exclusion/inclusion list be in included but the simplest way would be to treat the frame as part of the session. But this is not Microsoft it is the Chrome projects issue.

Safari: in pinned tab, download attribute with data href not working

In Safari 11/12, I have an tag with href="data:" and attribute "download" to save the file when the link is clicked.
<!DOCTYPE html>
<html><body>
<a href="data:text/plain;charset=utf-8,Hello" download="hello.txt">
Click me
</a>
</body></html>
This works fine in Chrome and Firefox, and also in an unpinned tab in Safari. Clicking on the link downloads the text "Hello" into a new file called hello.txt. However, in a pinned tab in Safari, the download attribute seems to be ignored and Safari opens the data in a new tab.
To see this you need to serve the above HTML code from a web server. If you just save the file and open it with a "file://" URL, it works as expected.
I have tried using a Blob instead but the behaviour was the same.
I have tried changing the mimeType to "application/octet-stream" which was a suggestion I found to a similar question. This does cause the data to be downloaded, but the filename is always "unknown.txt". This isn't suitable as I need to have control over the filename and extension (it's not hello.txt!)
As an extra note, the behaviour is actually different in Safari 11 and 12 but neither is working properly. In 11, the data is opened in a new tab. In 12, it opens a new tab but shows an error opening the data.
This looks like a bug in Safari to me. Can anyone suggest a workaround?
Thanks
It appears it is a well known bug and the download attribute is not yet supported by Safari (webkit).
https://bugs.webkit.org/show_bug.cgi?id=167341
https://caniuse.com/#feat=download

Issues on chrome showing an embedded PDF

I have the following code in a html document:
<p>PDF sample</p>
<object data="http://www.whateverdomain.com/whatever/~/media/sample.pdf" type="application/pdf"></object>
This is working in IE, Firefox but not in Chrome. Appears a grey box in the browser with no embedded pdf. When I check on "network" tab in chrome I'm receiving a HTTP 200 response but PDF is not shown.
I tried URL encode tilde "~" symbol replacing it by %7e but still its not working on Chrome.
I don't have the possibility of changing the url which is provided by an external service.
Do you have any clue on how to solve ?
You might wish to try and use a simple iframe. At the very least I am pretty sure that works for chrome, might not work for IE though. Another alternative is using the Google Docs viewer, with that you are sure to be cross browser compatible, although some pdf's might not render perfectly. The last option you have is using something like pdf.js to render the pdf's yourself inside the browser. Gives you a lot of control and ensures that even people running computers without a pdf viewer installed (or a native pdf viewer like chrome and firefox) will be able to view the file.

Chrome / Firefox inspector to edit HTML

I know I can edit HTML elements in Chrome / Firefox inspector. But how can I save changes to the local file on my desktop?
Chrome is able to do some stuff via workspaces. Open devtools go to Sources add folder to workspace pick your index.html (or whatever) edit and save by clicking ctrl+s. Refresh browser and you'll see that changes are permanent. You can't however go to Elements/Inspector pick some tag change it and save because "DOM!==HTML".
Yes you can edit a locally saved html file in IE9 by right clicking the page in the browser window, choosing "view source" which opens in notepad and editing the code and then go to file and save the changes.
You can do the same thing In Firefox by opening Firebug and then opening the Firebug editor which is notepad.
I just thought I remembered doing it by just right clicking the page and opening "view source" in Firefox just as I did in IE9.
View Source in Firefox allows you to play around with your code and edit it but to save and edit the actual working file requires opening it up, making those same changes, then saving. I'd suggest using the developer tools and once you have what you want, copying and pasting the altered source code to use in the original file. If you have firebug and the firebug editor I think you may then be able to actually update the file itself. Chrome allows you to edit JavaScript like that but I'm not sure about HTML and CSS
I have the same problem, how to edit the DOM html and save the results. On my PC I can effectively do this operation using Scratchpad by changing the file type to all, open the file, edit it, do a save, then refresh the page. With a bit of messing around you can copy and paste from the Inspector to the Scratchpad. It's pretty hacky, but it does work.
However, one of my students who is using a Macbook AIR can't edit html files with ScratchPad, she can edit .js files, but all the html files are grayed out and can't be clicked. Bottom line is I don't know if this "solution" works for all systems.