Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding 'Not allowed to load local resources'



On Apr 10, 2008, at 10:03 AM, Todd Thomas wrote:

I have a custom webkit based application where I'd like to be able to fetch local media resources from within html pages coming from a server.
Of course when I tried this I ended up with an error 'Not allowed to load local resources'. Is there an easy way to allow this within my own application?

Generally this is a dangerous direction to go in. With a man in the middle attack, someone could give you malicious content, and because you gave this content special privileges, it could get at any file on your user's computer.


Generally it's safer to come up with a way for the remote page to get special resources rather than trying to turn off the local resource security machinery entirely.

As far as I could tell it would require calling FrameLoader::setRestrictAccessToLocal(false) in WebCore which seems to be a bit difficult in itself. If I build WebCore myself and include it in my project and then include FrameLoader I still get errors because of the private headers FrameLoader.h includes. I guess I could keep going down this path and include the private headers folder in WebCore but this doesn't seem like the way to go.

This is not the way to go.

The other option I figured might work would be to create a custom protocol that webkit would think is non-local (say localfile://) and then read the file from the local filesystem myself. Is this the better way to go? This is an app we have complete control over the pages it views so using a custom protocol is doable.

That seems like a good option.

    -- Darin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >Overriding 'Not allowed to load local resources' (From: Todd Thomas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.