Manipulating downloaded file name? - google-chrome-extension

I am wondering if there is a way to intercept files being downloaded from Chrome and rename them before they are saved in the downloads folder. If this is possible, can the download location be altered? Thanks!

Related

uploading laravel-8 project in 000webhost error

I am trying to upload my laravel-8 project in 000webhost.com but my Public folder and resources and storage and routes and tests and vendor folder not uploading. I make my whole project in a zip folder and upload it public_html and extract my project than those folders not showing. but in my zip file, those folders and files are present what can I do?
i have this issue recently. Try to do this.
1st, open your laravel-8 project file and select all files except "node_modules".
2nd, right click and zip (make sure that the archiving method is .zip because 000webhost can't extract RAR archives.
for better understanding, open this link below:
https://www.000webhost.com/forum/t/deploy-laravel-project-on-000webhost/127323

Hiding folders in XAP file

As we know, we can see the contents of a XAP file by renaming it to .zip and opening it by any zip tool.
I would like to know if there is anyway to make the files/folders in the XAP file hidden?
i.e. If a person renames the XAP file to .zip and uncompresses the zip file to see the contents, that particular file/folder needs to stay "hidden." This is a requirement in my project.
Yes, the user may see the file/folder if he/she has selected "Show hidden folders, files, and drives" in Folder Options.
Unzip the archive into a folder
Hide several of the files/folders using the methodology your OS provides
Zip the folder back into an archive
Rename back to XAP
Be aware that this is an extremely weak protection for your contents.

How chrome extension download images to extension root directory

I'm making a chrome extension for the first time.
For my extension, I want it can automatically download images to its extension folder. For example, if the extension folder is /xxxx/abc/, I want it can download images to /xxxx/abc/image/.
To make it, I don't know how to write file/ download image to this directory. I don't want users notice this.
I found an extension can make it. It's called Momentum. It can download images to /xxxx/<extension root dir>/backgrounds/.
Can anybody tell me what technique do I need? Thanks a lot!
No, you can't. An extension has only read-only access to own files.
Instead, you can download to a virtual HTML5 filesystem and use files from it. See this tutorial - the big red warning means no other browser uses this technology, but Chrome does.
You may want to declare "unlimitedStorage" permission to make sure you have the space to store the files.
This being a virtual filesystem, those won't actually be files you can open on your disk. If you need to give files to the user afterward, you can use chrome.downloads to write them to the downloads folder, but that's "write-only", you can't access the contents afterwards.

Is there a way to use a downloaded (xml-esque) file in an extension?

I'm attempting to write an emusic download manager extension for Chrome. This would essentially involve parsing the .emx file (xml-esque) downloaded from the site to get the temporary music file URL.
I've gone through everything I can find online about extensions working with downloads, but the problem comes in that the .emx file isn't directly accessible from the web. The link to download it seems to pass through a counter for your account so that it can deduct the cost, and then it pushes a file 0.emx to be downloaded. It doesn't seem to work with any hotlinking, even copying and pasting the button's destination URL into the same browser tab.
I think the only way to get the file is to wait for the 0.emx file to be pushed. Is there any way I can use an extension to intercept that file before it goes to the downloads folder or use it after it's already downloaded?
Thanks!

Working with files NPAPI/PPAPI/NSPR

I need in Chrome extension these actions:
Download binary file to temp
Unzip it (it's clear .zip package)
Move files from unpacked directory, to directory of my extension
Delete temp files
I've been looking for similar what Firefox Scriptable XPCOM interfaces offer, https://developer.mozilla.org/en/XPCOM_Interface_Reference
Is there any simple way to do this, or I need to create the components myself in C/C++ and one of NPAPI, PPAPI, NSPR ?

Resources