Is it possible to check in/out files from a webserver with a FF-plugin or Chrome extension? - firefox

I am creating a CMS and want to know if its possible to download a folder, edit things and upload it back to the server without much user interaction.
For example just press a checkout button and the files are stored on your computer. after you are finished editing these files you press the checkin button. no selecting files again and such things.
Is it possible to access the filesystem and up/download files after a user gives you the permission?

In Firefox - yes, add-ons have full access to the hard drive and can download/upload files. See for example FireFTP, also code snippets.
In Chrome - no, extensions are not allowed to access the hard drive, other than limited access via File System API (which is a virtual file system actually). Best you can do is including a binary NPAPI plugin into your extension and making it write to disk. Users will see lots of scary warnings when installing this extension.

Related

Alternative to Windows Alternate Data Streams

I have the following need to implement on Windows: file with files.
Originally I was thinking to use directory with extension. Something like "folderA.myappext", so when user clicks on it in Explorer, my app is launched instead of folder being opened. Unfortunately, I was unable to find a way to do that. Then I tried to use Alternate Data Streams. This works just fine, but several problems with it:
It works only in NTFS, so no way to send it via email or FTP as is;
Only WinRAR can properly archive it, and you still have to do extra clicks in the UI for that;
The real file size (with all streams in it) is not shown in Explorer and does not participate in showing free/used space, which can very quickly lead to big problems for the user.
No, I can't use zip or any other way to combine files into one - this is high-performance app that also requires write streaming (i.e. it changes data all the time).
Any idea how else to achieve my need on Windows? I know on MacOS you can use 'package', but there is nothing like that on Windows. Any idea?
Something like "folderA.myappext", so when user clicks on it in Explorer, my app is launched instead of folder being opened.
You can't do it based on the extension because folders don't have extensions but you can do it with desktop.ini. Windows 7 and later supports custom verbs on folders.
A working example can be found here.

Reason why folder associated with saved webpage gets deleted when we delete saved page

I have saved a complete webpage and there is also one folder saved with resources but when I delete webpage or move saved webpage to other directory then the folder associated with it also gets deleted or moved. So what is the code written behind it. Because I want to do same with my webpage and folder.
Thanks in advance for you kind help.
This "association" between the HTML file and its resources folder is a behaviour implemented by the Windows operating system.
It has nothing to due with a webpage in particular, with its HTML, JavaScript, or even with a particular browser.
Windows 2000 provides a simple way to connect a primary HTML file to its group of associated files. If Connected Files is enabled, when you perform any of the commands [Copy, Cut, Paste, Move, Delete, Send To] on a file or folder of associated files, the same command is performed on all connected files.
Even though the official page mentions "Windows 2000", the same behaviour is implemented in Windows XP and many (if not all) later versions of Windows.
See these pages:
Removing file / folder link after using “Save As…” then “Web Page, complete”
Operations on an HTML file or folder apply to similarly named folder or HTML file (from Microsoft support)

How to install unpacked extension in firefox & chrome?

i have created extension by using crossrider they gave me xpi & crx file which i extracted and want to install manually by copying data to the browser's extension path.
I've read & tried many posts regarding this but they are not helpful because i think some posts are old & not able to find target paths & registry.
like in many posts they say create the following key in the registry here
32-bit Windows: HKEY_LOCAL_MACHINE\Software\Google\Chrome\Extensions
but i couldn't find that on my windows registry & i am using 32bit.
i want something like i copy my extension data to the browser's extension directory & inject some registry value thats all. if it possible then How?
For firefox just add the xpi or unpacked folder to the profile folder. No need for registry so its cross platform.
It can't be automatic as spyware would be all over that. After placing xpi in the extensions folder of the profile, on next startup of Firefox it will prompt saying it found an unauthorized by user add-on, and gives user a chance to enable it, or keep it disabled.
If you want to do it without startup, just launch the file path to the xpi or unpacked folder (if unpacked folder doesnt work, then point it to the install.rdf) in the browser, user will be prompted if they want to install.
There are some registry options though: Install Firefox extension using Windows registry
In Chrome, it's no longer possible to add an extension programmatically on Windows unless the extension is actually published in the Store.
This is for security reasons: previous registry-based (and otherwise) methods were open to malware abuse.
If your extension is published in the store, you can add it semi-automatically via registry. The user will still be asked whether to enable it on the next load.
You can also install extensions silently using Enterprise policy (only if the machine is part of a Windows domain and you have admin rights on the domain policy), on other OSes, or load it unpacked for testing with the --load-extension command line switch (will not persist after Chrome is restarted).
In Chrome go to
chrome://extensions
Enable Developer Mode at the top and click on the button to load an extracted extension.

Creating a local folder through an url

imagine you want to have a link on a website that creates a local folder and opens it in the Windows Explorer as soon as click on it. Something like Go to new folder
I know there is the file:-protocol, but this only opens a local folder. Is there a way to specify in the url that the browser should also create the folder.
It might be against lot's of security policies. But I'm just curious if there is any way you could achieve that. What ever come in your mind? Don't hold back.
Cheers,
Gerardo
As you mentioned, this is not allowed for web pages from internet. (imagine a rogue script running thousands of these)
You may be able to open an existing folder, in the browser (not via Windows Explorer, unless it's IE and the page is trusted).
If you want to create a folder, try using Offline Storage APIs for HTML5. This may not accomplish the 'opening in Win Explorer' part, but you can store data on user's machine.
Hope this helps.

How does folder hiding software work?

Last few days i have been working on building an application to hide folders(thanks to the paid versions of such softwares). After a heavy googling I zeroed into some shell script that would first create a folder and then rename the folder to "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}". It would then hide this folder by using the command attrib -s -h Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}. The funda behind this is to make it a system folder and hide it. But if you would uncheck the Hide sytem folders in Folder option the control panel becomes visible. I would like to make this folder completely invisible as how the other folder protecting softwares do.
Can somebody throw some more light on this?
Thanks a ton...
Most folder hiding software works by implementing either an extension for Windows Explorer or a file system filter driver.
The first method means that certain items will not be visible when browsing folders in Windows via the UI, but will still be visible to other software and via the command prompt. For example, the Recycle Bin and Temporary Internet Files folders work this way.
The file system filter driver method proxies calls between Windows and the underlying file system and only allows certain requests through. This is similar to how virus scanners prevent access to infected files.
The general idea is that you hook the file system API's and filter out the file system entries you want to hide.
But JelloMonkey is right - this is rootkit behavior and you will get flagged as malicious by rootkit detectors for this kind of behavior. That's likely to get your entire directory quarantined or deleted.

Resources