I have an html app, with html, js, css and images, which I need to distribute on a pendrive for Mac and PC. When users open the app, however, they're receiving security errors in their browser.
I'm looking for a simple solution to this, but I can't find any easy way of opening a html app from a pen drive. Any solutions would be greatly appreciated.
EDIT:
You are right The error come from ajax local call to xml files.
Anyone has a solution ?
In reference to question - How can I make local ajax calls to xml files when distributing my html project locally?
The users who are having problems is probably due to the browser they are using and the state the browser was initialised in, as some browsers by default allow local ajax calls to files and some don't.
You have two options.
To your users specify a browser to run it in (for example chrome automatically disallows local ajax calls however if started with the flag --allow-file-access-from-files it will allow this behaviour)
Host the files on a web-server either in the flash drive or externally.
I think I have the solution.
With the mongoose portbla web server, I can launch a small web server without installation on mac an pc.
I just have to find how to put my page as default.
I wish it will help someone with the same problem.
Related
I want to send an HTML email with link in them. The link should open files from a windows shared drive. The users will already be logged in to the network via VPN.
I've tried
Test Report
This works fine when opening on a PC but I can't figure how to open this in an iPhone although the users accessing the network thru a VPN client on their phone.
I'm open to use any third party solution
This link is for IPADs, but it should work with Iphone as well:
https://discussions.apple.com/thread/3978480?tstart=0
According to Apple's forum, you need to use some sort of third party software to access files, like filebrowser (link in the forum page). Personally, I use filebrowser and it works fine for me. It works kind of like WinSCP for windows. It pulls data from a Server (your vpn) and allows you to download and modify on your phone. It is cross platform compatible, so it is great if you have multiple devices. I have heard that FileExplorer Pro is exceptional, but I have not tried it. Here is the link to fileexplorer on the app store:
https://itunes.apple.com/us/app/fileexplorer-pro/id499470113?mt=8
EDIT:
As far as I know, this is not possible from any mobile device. Best bet is to send the file through a secure email, such as ProtonMail.
iOS is less flexible when it comes to file management and file associations, so there’s less you can do with these files. However, you can still open a video file directly from your shared folder and play it on your device or access other media files in a similar way. You could also use the “Open In” feature to open a file in a specific app.
The Windows network file sharing protocol is known as CIFS, which is an implementation of the SMB protocol.
this guide may help you. this is not exact answer about what you want though. https://www.guidingtech.com/27119/access-shared-windows-iphone-ios-wifi/
In my app I'm viewing a list of files on the local machine (their paths are fetched from DB). When a file is being clicked, it should be opened. I tried the following with no success:
FileName
When the user clicks the link above, nothing happens. When using chrome, I can see the following error message in the console (on firefox there's no message):
not allowed to load local resource
I have read this question, and understood that:
Mozilla browsers refuse to follow file URLs on a page that it has fetched with the HTTP protocol.
I also understood and that this feature was implemented in other browsers as well.
The presented files are not located in the server, but on the local machine. So I can't use a relative link (right?). Is there anyway to bypass this and create a link that opens a local file?
You cannot access local resources from a website served over http because it is a security concern. Think of what would happen to your machine if any website could access files on it. You'll have other security restrictions for serving data from a different domain from your domain as well.
What exactly are you trying to accomplish by accessing a local file? Giving additional insight into the reason might get you more useful suggestions. Otherwise, the answer is that you can't and shouldn't do this.
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
I am building a packaged chrome app (It is needed as I want to access chrome.socket). I have a website from which I would like to call my app (if installed or ask the user to install it) by clicking a link. Is this possible ? Not able to find any easy way for this workflow.
The url_handlers might be the best way to achieve this.
You can also use the externally_connectable manifest property to declare that your website can connect to your app, then call chrome.runtime.sendMessage or chrome.runtime.connect from your webpage and handle it in an chrome.runtime.onMessage handler in the app.
Which one is better suited depends on your needs. The url_handlers is an easier way, but it will permanently assign the URL on your link to your app, so you won't be able to use it for anything else if the app is installed. The externally_connectable is a harder way, but it enables a much more elaborate bidirectional communication between your website and the app.
You can even use a combination of the two approaches, if you need: launch the app using the url_handlers feature, then establish a communication channel back to the website once the app is up and running.
Apps can now (as of Chrome 31 I believe) register to handle urls by adding url_handlers in their manifest and detecting the url causing the app to launch in the chrome.app.runtime.onLaunched event. If the app doesn't launch, your hosted web site will be loaded an can present an inline installation with chrome.webstore.install.
I'm working on a web application that caches html pages and saves it on the user's computer. I want to create a link, so that the user can click on the link and access the cached webpage.
Following is my link to a cached page:
BBC
When I click on the link, nothing happens. I'm not even getting any error.
Can someone please suggest how to create a link to a cached html page?
First of all, not all browsers handle local files equally, indeed, not all computers will be running windows or have a C: drive. Secondly, you don't have much control over a user's cache. Cached pages are usually handled by the browser automatically. You can use headers to specify how a browser ought to cache files, but it's not even required to do so. You can read the W3C recs on caching for more information.
It's unclear what you're trying to do here, but it sounds like it might make more sense for you to use HTML5 local storage or offline files than trying to mess around with their file system directly. The security model of most browsers is such that web apps don't interact with local files, which may be why it's not working for you with your current setup. Dive Into HTML5 has a good overview of HTML5 local storage and offline pages.
Edited based on comment below:
Most browsers' security settings won't let a page on a website access files stored locally. Only locally saved files can link to other locally saved files. Therefore, if the page with a link is on a website, your link won't work. Try creating a link to your file from another locally stored file and see if that works.
Instead of providing the .html extension in the main page where you provide the link you should do something as below:
< href="file:///C:/Users/xxx/yyy/bbc">BBC</a>