Yasir
Yasir

Reputation: 69

Can chrome extension modify a file in our hard drive?

I am making a chrome extension which needs to add/delete/modify file in any location in our hard drive. The location can be temporary folder. How is it possible to make it. Please give comments and helpful links which can lead to me have this work done.

Upvotes: 1

Views: 4626

Answers (2)

BananaAcid
BananaAcid

Reputation: 3471

You can not, but adding a local server (nodejs/deno/cs-script/go/python/lua/..) to have a fixed logic (security) to do file stuff and providing a http server to answer back in an ajax/jsonp request would work.

The extension will not be able to install the software part.

edit: if you want to get started using nodejs, this could help

edit2: With File and Directory Entries API (this could help) you can get hold of a FILE OR complete FOLDER (getDirectory(), showDirectoryPicker()).

Upvotes: 1

jwize
jwize

Reputation: 4165

Thankfully, this is impossible.

Google or any other company wouldn't have many friend if their extension(s') installation caused compromise including complete control over any files(ie. control over machine) on your hard drive. The extension can save information to disk in a location that is available for storing local information as mentioned. You will not have any execute permission on the root or anywhere nor will you have any read or write permission outside of the storage location.

However, extensions can still be malicious if they gather information from a user of a web page (I am sure that Google can filter some suspicious extensions).

If you really need to make changes on your hard drive you can store information on a server and poll for changes with a windows client application or perhaps you can find where the storage information is kept and access it from there from a windows app.

Upvotes: 0

Related Questions