phpdesktop icon indicating copy to clipboard operation
phpdesktop copied to clipboard

HTML5 persistent storage - quota requests are denied

Open GoogleCodeExporter opened this issue 9 years ago • 2 comments

Need to implement CefRequestHandler::OnQuotaRequest:

  ///
  // Called on the IO thread when JavaScript requests a specific storage quota
  // size via the webkitStorageInfo.requestQuota function. |origin_url| is the
  // origin of the page making the request. |new_size| is the requested quota
  // size in bytes. Return true and call CefQuotaCallback::Continue() either in
  // this method or at a later time to grant or deny the request. Return false
  // to cancel the request.
  ///
  /*--cef(optional_param=realm)--*/
  virtual bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
                              const CefString& origin_url,
                              int64 new_size,
                              CefRefPtr<CefQuotaCallback> callback) {
    return false;
  } 

Original issue reported on code.google.com by [email protected] on 2 May 2014 at 6:26

GoogleCodeExporter avatar Aug 28 '15 11:08 GoogleCodeExporter

A javascript example for requesting additional space for local storage or 
indexed db:

https://code.google.com/p/phpdesktop/source/browse/phpdesktop-chrome/www/request
-quota.php?r=a08269c0e01b

Currently it doesn't work, the result is "Granted 0 bytes". OnQuotaRequest 
needs to be implemented to fix this.

Shall we allow all quota requests? Or should it be configurable through 
settings.json? For 127.0.0.1 all requests should be allowed. For other internet 
domains a limit in the settings.json file may be a good idea.

Original comment by [email protected] on 3 May 2014 at 8:03

GoogleCodeExporter avatar Aug 28 '15 11:08 GoogleCodeExporter

Fixed on Linux in commit 170d7c3.

cztomczak avatar Feb 03 '19 12:02 cztomczak