|
|||||||||
|
|||||||||
|
|||
|
So, I got curious after work one day and decided to figure out how to write a simple MobileSafari plugin. This took me 3 days.
This one lets you download most zip and tar files. I tried to make it download png, gif, and jpgs, but because Safari handles it already, I don't think I can ever make that work. This was developed targeting 1.0.2. I haven't tried it on 1.1.1 or 1.1.2. (Updated) XianLi says in this thread that it works fine for him on 1.1.2. No warranty or liability of any kind, of course. Don't blame me if it somehow messes up your data, though it isn't supposed to affect anything outside the Downloads folder it created. How to use: Copy the plugin bundle into "/System/Library/Internet Plug-Ins", and then reboot the phone. It will create a folder called Downloads next to Library and Media in your root home folder. It will only download there. When you click on a link that is downloadable, a large button will appear. Click on it to download. Click the normal page back button to not download, or to go back when it's complete. http://www.badongo.com/file/5544413 Update: Version 0.2 posted. New to 0.2: Progress bar. Basic instructional text. Allow user to choose name to save as. Features tried and failed: Percentage and KB/sec as text. I have the value as a variable, NSString simply fails to display it correctly on 1.0.2. Anything else I want to say cuz you're still reading: Yes, it looks kinda ugly. Please don't post any requests for other plugins in this thread. That's a good sign for me to ignore you. Like any other projects I do publicly, whether or not I continue to improve it is based off how much time I have outside of work, whether or not I feel like working on it, and the quality of feedback I get. (seeing stupid posts with awful use of punctuation and no real content or irrelevant content makes me lose interest fast, seeing high quality posts like "By the way, if I do this, this, and this, it crashes. I think you might have forgot to check if such and such value happens to be blank" makes me feel appreciated because you're showing to me you actually care and are trying to be constructively helpful.) Last edited by hachu; 12-11-2007 at 07:00 AM. Reason: Updated for 0.2. |
|
|||
|
Works well for me on 1.1.1 .. let me download it fine.
For anyone that doesnt know.. it saves it in /var/root/Downloads I also tried adding extensions to the plist, but that doesnt seem to work, is there something that needs to be added to the LCDownloader aswell? If so can you please make this opensource so we can experiment ourselves ![]() Looks very promising, hope a lot more extensions will be added! |
| Sponsored links Remove advertisements | |
|
|
|
|
|
|||
|
You'll have to add the mime type that it appears with, so use the tar and zip examples and replicate that.
The app itself doesn't carry the mime/ext info, so it's just the plist. This is because of how the plugin system works, so I don't think can't change this. (at least that's what the docs seem to say) I added entries to the plist for image types, but I either got the wrong mime types or Safari skips trying to load plugins for those because it knows it can handle them itself. So feel free to experiment on that. Also, I don't know what happens if you add anything that is normally supported by the Quicktime Plugin. So, I didn't try mp3s. The source looks like a complete mess because I tried to display more info using a UITextField and it didn't work, so I'll consider releasing it later when there's no longer more code commented out than actually running. Quote:
|
| Sponsored links Remove advertisements | |
|
|
|
|
|
|||
|
Ive found the one required for .avi files..
add this to the plist.. Code:
<key>video/x-msvideo</key> <dict> <key>WebPluginExtensions</key> <array> <string>avi</string> </array> <key>WebPluginTypeDescription</key> <string>avi File</string> <key>WebPluginTypeEnabled</key> <true/> </dict> |
|
|||
|
Great plugin, can't wait for the sources
|
| Sponsored links Remove advertisements | |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|