Page 1 of 1

Replicate chrome request to store large data?

PostPosted: Sun Mar 31, 2013 5:48 pm
by Stidor
Hi all,

I'd like to somehow allow the ability for websites to store large data permanently. When you visit a site that requires this in Chrome you get the following popup.

Image

After doing some searching I've seen a few mentions that with CEF3 it's not possible to adjust the local storage size from the default 5mb. Is this correct?

Re: Replicate chrome request to store large data?

PostPosted: Sun Mar 31, 2013 6:01 pm
by magreenblatt
Stidor wrote:After doing some searching I've seen a few mentions that with CEF3 it's not possible to adjust the local storage size from the default 5mb. Is this correct?

This is correct for localStorage, but there are a few different storage systems in the browser. Most likely you're interested in webkitStorageInfo.requestQuota instead of localStorage. requestQuota will result in a call to CefRequestHandler::OnQuotaRequest() from which you can allow or disallow the storage allocation request.

Re: Replicate chrome request to store large data?

PostPosted: Sun Mar 31, 2013 6:50 pm
by Stidor
Ahh. That makes sense. I think that might be what I'm after then. Will have to do some research now to see how to handle calls to CefRequestHandler::OnQuotaRequest().

Not much sample code around, will browse through the demo code and see if anything similar is done there.

Re: Replicate chrome request to store large data?

PostPosted: Mon Apr 01, 2013 7:30 pm
by Stidor
I'm struggling a bit to figure out how to extend CefRequestHandler :/

I've got the browser control up and running in a project...but to extend it I'm scratching my head a little. I've been looking through the example code and some other snippets posted online. Found something kind of similar in a resourcefactory but it won't seem to let me extend CefRequestHandler that way.

Code: Select all
Private Sub createBrowser()
        Xilium.CefGlue.CefRuntime.Load()
        Dim mainArgs = New Xilium.CefGlue.CefMainArgs(New String() {})

        Dim cefSettings = New Xilium.CefGlue.CefSettings
        With cefSettings
            .SingleProcess = True
            .MultiThreadedMessageLoop = True
            .LogSeverity = Xilium.CefGlue.CefLogSeverity.Error
            '.LogFile = "C:\Projects\cefGlueDemo\cefGlueDemo\bin\Debug\CefGlue.log"
            .CachePath = "C:\Projects\cefGlueDemo\cefGlueDemo\bin\Debug\cache"
        End With

        CefRuntime.Initialize(mainArgs, cefSettings, Nothing)
    End Sub

    Private Sub loadBrowser()
        browserCtl = New CefWebBrowser

        browserCtl.Dock = DockStyle.Fill
        browserCtl.BringToFront()

        browserCtl.StartUrl = "http://www.google.com.au"

        Me.Controls.Add(browserCtl)
        browserCtl.CreateControl()
    End Sub