If I paste an html link with a href that doesn't start with http:// in an html editor in Chrome or Firefox, then result is not the same. Chrome keep the href attribute but Firefox removes it.
So if I paste a link (which has this source code Open PDF) in the HTML mode (not the source code mode) of an HTML editor in Chrome, and then them switch to the source code mode, I see the exact them source code as above. But if I paste the same link in an HTML editor in Firefox, I end up with this source code:
<a target="_blank">Open PDF</a>
The test can be done with Quackit.com. When I start Firefox in Safe Mode, then the href="zotero://open-pdf/0_123456" isn't removed.
How can I paste a link in an HTML editor in Firefox when its href doesn't contain an http://?
More background: I am creating this link with a python script based on HtmlClipboard
I tried all the solution on that page but without success. My issue doesn't seem to be the same. I don't have any trouble opening a local link with firefox: if I paste zotero://open-pdf/0_123456 in the url bar, firefox open the pdf. I have trouble pasting the html link in an html editor.
After all, it wasn't caused by Firefox but one of my extension because the problem disappears when Firefox is in safe-mode (on Windows, Windows + R and enter firefox -safe-mode). This doesn't resolve my problem, but at least it answers this question.
Thanks to jscher2000 for pointing that to me.
Related
The below URL shows some XML in a <code> tag. It works fine in say Edge and Firefox but in Chrome, the markeup shows for a second then disappears just leaving the values as you can see below. Why is this happening in Chrome?
https://basketball.exposureevents.com/api/resources/venues
First, try hard refresh, it's simple thing that may solve the problem (if the source of it is in the specific site's CSS/JS code) (Windows: Ctrl+F5, Mac: Cmd+Shift+R)
Second, try update you'r Chrome to the last version (70.0.3538.67), go to on the top bar, there you can see if there is a new update (if there is, it will show up at the first line).
You can check you'r Chrome's version in this link: chrome://settings/help or go to on the top bar > Help > About Google Chrome.
If you'r Chrome is up to date, you may have some plugin/s that removing the xml tags.
Try accessing to this page via Incognito Mode (Windows: Ctrl+Shift+N, Mac: Cmd+Shift+N).
If it's working in the Incognito Mode, back to you'r main Chrome and then click on on the top bar > More tools > Extensions. Then, disable all of them and try to enable them one-by-one, on each one you'r enabled, go and check again if the problem is still there.
*Note that some plugins may be enabled also for Incognito Mode, so try the last step anyway.
Update: As much as I understand, the root issue is that your code was wrapped with html <pre> tag, that makes the browser to treat the XML as HTML tags, that are invisible when rendered in browser.
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
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.
I'm testing a locally run web app and am trying to use anchor tags to link to log file output on my C: drive. The href value that's generated for the anchor is in the standard URI format "file:///C:/outbox/myLog.txt". But, when I try to click the anchor, the link doesn't go anywhere, I have to right-click and copy the link into the address bar or to a new tab. I'm not sure why copying the link works whereas the link itself isn't clickable. Any help is appreciated.
Is this the case on different browsers? What is your browser / OS? We've seen this as a fault on Windows XP on both IE and Firefox browsers and may be nothing to do with your code
From my understanding, you can't link to file:/// from an HTML doc for security reasons. You might want to try this chrome extension.
i have a simple web page with a list of links linking to specific pages in a PDF file. This works fine in Firefox, IE 6,7,8,9 but not in chrome?
The code is very simple and works in everything else. In chrome however it just opens the PDf on the first page.
Help please!
Adobe Reader supports #page=X as a postfix to the URL in order to jump to a specific page in a PDF document. Chrome's PDF reader doesn't support this at the moment.
This is a known bug that has been filed as http://crbug.com/65851; please star that bug in order to follow the progress.