I have a HTML file with javascript which runs locally on my pc. (Not using server!)
When the program runs in error, it creates a log TXT. I am using 'console.save' script.
My problem is that chrome doesn't automatically downloads the second txt, because it asks for permission to download. If I give permission it works but only until I refres the page. After refresh it won't work.
I tried in "chrome://settings/content/automaticDownloads" to give permission but it does not work. It's not an URL, it's a "file:///C:/index.html".
In the settings I have only 2 options. To deny the download or to ask for permission. There is no option to allow all downloads.
Is there any way to allow it?
In Chrome, go to this url:
chrome://version/
There you can see the Profile path. Go to that location. By default it is:
C:\Users\YOURUSERNAME\AppData\Local\Google\Chrome\User Data\Default
Here, find the Prefrences file. Before editing, close Chrome. Then edit the prefrences file with any text editor and add this:
"default_content_setting_values":{"automatic_downloads":1}
Now Chrome will not ask for permission when it want's to automatically download files.
Related
I would like to replace a javascript file in my Google Chrome cache such that when I reload a website it will run my modified script. I could do a whole setup with puppeteer instead but it would be just way easier if I could just replace the cached file. However, I cannot seem to locate my cache or any info on wether this is possible since the data might be encrypted or encoded. Alternatively is there an extension that would let me do this?
You can replace a JavaScript file in your Google Chrome cache by following these steps:
Open Chrome and press F12 to open the developer tools.
Go to the "Application" tab in the developer tools and select "Cache" from the left sidebar.
Find the JavaScript file you want to replace in the cache and select it.
Right-click on the selected file and choose "Delete" to remove it from the cache.
Refresh the website to reload it and run your modified script.
To run the modified script, you can use the "Sources" tab in the developer tools to open the file and paste in your changes.
I have an page with some forms. All the links work fine in IE. They open in a new tab nicely when the hyperlink is click by the user; however, I realized that when Chrome is use the link doesn't open. I keep clicking but nothing opens. The only way of opening the file is copying the hyperlink, opening a new tab in Chrome, paste and go.
Form1
Is this something that browser do? Because I tried it with FireFox and doesn't work either?
It there a way of going around? without installing anything in the browser? Because my user loves Chrome.
Thank you in advanced for the responses.
You can't access to files outside your server or "SandBox", sandbox include the files that user push to the browser or to your server.
If the access from browser to a pc files from web pages was possible, it would be a security problem.
The answer is that you can't with your approach and more importantly you shouldn't. Chrome behavior is in fact the right behavior and it protects you from having malicious users and/or scripts accessing your local resources.
The FILE protocol will access local or defined network named resources which will not be available to a remote user that visits the same page. In other words, you may have outsideserver mapped as a network resource/drive but someone else will not (This does not apply to IPs)
Here's what you can do:
Move the code to a server side script(php, asp, etc) and stream the file back out. Found a quick example here on SO. I did not verify it though. Streaming a large file using PHP
Install a webserver on outsideserver and map a new site to the shared folder. You can then reference it via http (http://outsideserver.com/form1.pdf)
Use the below extension for chrome. It will work.
Enable local file links
Below both options are working and tested.
Link 2
Link 3
The default behavior for chrome.downloads.download is to download to the default download folder. It doesn't remember it if you change the folder. Can we save the download-to location for the next call-out?
References: https://developer.chrome.com/extensions/downloads
It's concerning that Chrome actually doesn't provide the ability for an extension to get the last download path. Some say, it's due to security concern and others say, there is no significant need to have the API available to users.
You also cannot store the download path in your extension because Chrome doesn't let you get the selected download folder. I hope Google provides us with the either of these features later.
This is not a supported feature, according to this Chromium discussion.
Summary:
If you specify a filename, it's never possible to save outside of ~/Downloads (this is a bummer, for me)
You should be able to manually implement something (in a subfolder only) using the id returned from Chrome.downloads.download
A few quotes I like (edited for brevity and politeness):
Would like a download option to choose recent download folder. Would be good to remember last download location per website, like you other settings.
Seems reasonable.
Chrome does remember the last chosen directory if no filename is specified to downloads.download with Save As... Given how Save As works without specifying a filename, my intuition would be it would work the same with a filename... but it doesn't.
That one is interesting. So it kind of supports it already. There's no security concern with saving outside of Downloads.
I have just been able to restore the "remember last download location" functionality, which used to work on my previous machine, in a new install by disabling extensions and Chrome apps provided by Google. This is what I have turned off:
Extension: Google Docs Offline
Chrome Apps: Docs, Sheets, Slides
I haven't tried to narrow down which of these have been the culprit, or if any other extensions (I have a bunch) have played a role. So YMMV. Good luck :)
SOLVED. Very simple way: Insert a USB-drive or SD-card. Go to chrome settings, and specify this drive as the default download location.
Remove the drive/SD-card. Download something - the first time you do it, Chrome will offer to save to your user document folder, but instead, you save it to whereever you want.
This location will be remembered next time. Voila. So easy.
In fact, you can save previous the download location.
If you do a clean install, first of everything, change the download settings to "ask every time". It is very important not to click the text box where you can specify one download location (if you click there just once, you need a clean install again).
Chrome will then bring up the download window with your last save location.
Furthermore, you should uncheck the "settings" in the sync preferences because it will break every time you sync your settings to a new browser.
I have hosted a HTML file created on my PC (along with a stylesheet) on Google Drive using the script described here.
I have given out the link and it seems to be working fine (no reported issues from those I've sent it to).
I have just discovered a minor omission from the file, I need to add another sentence. This should be ridiculously easy on a PC, I could just open it on notepad!
I can't find a way to edit it on Google Drive, the only connected apps are the viewer and Docs.
The viewer, as the name suggests, will only let me view the HTML, and the docs app won't let me save it back to the original file.
Obviously I could download it then upload again, but from experience it will probably give me a different URL.
Is there any way for me to do this while keeping the link the same, as I have already given the address out?
Currently you can't. You can only preview html files, that is preview the code or preview the rendered content, but you cannot natively edit the code. You have two options:
use a third party extension, such as Neutron Drive or Drive Notepad.
install the Google Drive Desktop App, edit your files locally and save. Changes will be uploaded automatically.
I have just used HTML Editey chrome app
You can do this through file revisions. Hopefully, Google adds another way, but using the revision feature works for me. To revise your file, click the check mark in the Google Drive file list, click more, and then click "Manage revisions...". In the box that pops up, click upload new revision and then you're set.
You may also be able to edit html files stored in google drive through other plugins, but I do not use any at this time to know of them.
Update!
go to drive right click your html file
choose "open with" then "connect more apps"
when app library pop up search for "notepad" then choose "drivenotepad"
after it connect to drive, select it, you will get code editor.
I have a Box application that has Even Notifications enabled for all events. I tested it with multiple accounts and triggering different events; it works fine. I use InkFilePicker to choose a file from Box. Following the InkFilePicker link also works fine.
The way this works (as I understand), InkFilePicker downloads a copy of the file from Box to S3 and gives me a URL that points to the copy. Then how come I don't get notified of the download?
What I'm trying to do is
Let a user choose a Box file.
Get this file's id to process its Event Notifications.
I asked them and this was their response:
We don't download a file from your box. The file is uploaded from your
box account when you select a file and hit upload. As a developer you
can see these files in your admin account.