Access Chrome extension from another computer - javascript

I coded a little app for Chrome, it's a privacy extension and I want to be able to access it from outside my computer. I read a lot of thing about contents scripts but I don't know if is the way to go. In my extension I have a option.html file and I want to be able to access it if I'm not at home. The file is actually stored on Chrome tabs when I open it. I want to access it but only from my domain, all request must be not executed. Do I have to make a websocket on my extension? Or can I put an iframe into my option.html and read it from a server side with php script?

You need to convert the folder into a .crx type.Visit https://developer.chrome.com/extensions/hosting for more info

Related

Open local resources with browser in intranet ASP.MVC application

I have a ASP.MVC app running in my company's domain. I would like to make links to Word, Excel or even to folders. For example I would like to allow user to access a project folder on public drive or Office document. Files and web app are on different servers, but in same domain.
The problem is that all modern browsers block access to local files. (Chrome throws an error saying "Not allowed to load local resource: file://..."). IE we are currently still using does allow that, but I can't rely on this.
How to tell the browser that it is safe to open those links?
I read about an option to serve .url files to user with link to file/folder. The downside is that I'd fill users temp folders with .url files. And also while I was testing this, I couldn't make changes to .url file after I saved it. Even removing the file doesn't help. It looks like windows stores it somewhere.
Another option was to make an a-tag with href like "data:text/plain;charset=utf-8..." and offer user to download .url file that way. But it was somehow not working for me.
Please help.
Thank you.

localStorage access from local file

I am creating 2 HTML files that will be stored an an iPhone locally and accessed through a WebView.
I am wondering if it is possible to set localStorage in one file, and get the results of the storage from the other file.
I know that localStorage is accessible from files on the same domain, however, it appears that you can not get the value from a different local file?
I have also tried running this in Safari on the desktop with local files and the same issue occurs.
When you are opening the files locally, i.e. using the file:// protocol, as of now the browsers can not determine what is "same domain" so every file is considered a separate domain. Thus you can not use localStorage when you're opening the files.
Here is some more information on the problem in FireFox: https://bugzilla.mozilla.org/show_bug.cgi?id=507361 . Personally I couldn't find much about Safari on this topic.
You can also look over this: Javascript/HTML Storage Options Under File Protocol (file://) . It might be helpful in your situation.
At this time, local files rendered via WKWebView on iOS 10 share access to the "same domain" with respect to localStorage. Unclear whether this is by design or a bug, however.

Access local files from HTML5 Desktop Application in html folder

HTML5 is great and I can replace my existing desktop application with it, but just a little security restriction prevents me to complete my job. I plan to create a simple desktop application completely with HTML5 so it can run on any mobile and desktop devices that support HTML-5.
I know about the browser security on local file and the reason behind it, but I don’t know why I couldn’t find a way to grant read-only access to a folder as sandbox. My application does not need to write a file or even does not need to read a file outside of It main html folder. It needs to read the local file just in same folder same as it do on domain.
So please let me know:
Can run browser with specific command to force it grant access to local file that exists in same folder of HTML? It should not disable all local security restriction just grant HTML access to file in same folder or subfolder.
Is it cross platform method to map a local folder as local host that work on mobile platforms?
Is there any manifest file exists to put in folder to grant read access in same HTML folder?
Is there any way to grant read-only access to a folder as sandbox?
Note: I don't want use third party solution such as XULRunner, Mozilla Prism, Adobe Air or any other third party, I need HTML-5 solution to be cross platform if there is any.
Any idea is welcome.
If you need that file so much, why not just load it dynamically inside a JS script as a json object.
So, in other words, put the contents of the file into a js script, and strucutre the file contents into JSON format, then load that script on load or when you require it.
Alternately if you need file IO use localstorage.
according to this site, launching chrome from the cmd with the parameter --allow-file-access-from-files will disable this security feature

Is cross window-domain scripting possible?

Lets say for example i have an google search results page opened in a window or a tab in firefox.Is there a way i can retrieve the html code of that tab or window using javascript?
I suppose that the webpage html is saved temporarily somewhere in computer memory.
Can i load the webpage using memory saved address?
Is there a way for javascript to read html files saved in the same folder as the original?For example i have saved the webpage in a folder on my computer.If i create an html file inside the same folder does javascript consider the saved webpage as the same domain?
No, you most certainly can't do that unless you control both pages. This would be a huge security hole.
There is a custom search API which may help if you specifically want to do Google searches. It appears to have a JSONP implementation which should let you make a cross-domain request, but I haven't tried it out so I'm not sure how well it works.

Javascript accessing a local file on computer

is there a way to allow a domain access a file which is stored on my computer?
I wish to inject javascript a tag into a website, with the source as a file stored on my computer. This works within a local test.html page, but not when trying to run the script on an actual domain.
Is there a way to set this up my changing window's host file?
Edit - it MUST work in IE
Clarification :: I wish to use javascript injection (using the javascript: protocol) to manipulate the DOM within IE, this is fine. There is however an 8k byte limit within the address bar, which isn't enough. Therefore I wish to store it within a local file on my computer.
Instead of storing it on your computer you could store it online and then load the Javascript through a much smaller amount of code in the address bar.
It's explained how to do this here
http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
Try the file API if you're on a recent browser. https://developer.mozilla.org/en/using_files_from_web_applications
If not and you're on IE, you should be able to do it with ActiveX but it'll always ask for permission.

Categories

Resources