1

I'm building a Quickly ~ HTML5 Application, it works great until I try to use WebSQL Storage, which fails to open a databse:

var db = openDatabase('mydb', '1.0', 'Test DB', 5 * 1024 * 1024);

giving the next error: Error: SECURITY_ERR: DOM Exception 18

The Python code that calls the webview is this:

    self.webview = WebKit.WebView()
    self.scroller.add(self.webview)
    self.webview.props.settings.enable_default_context_menu = False
    self.webviewsettings = self.webview.get_settings()
    self.webviewsettings.set_property("javascript-can-open-windows-automatically", True)
    self.webviewsettings.set_property("enable-universal-access-from-file-uris", True)
    self.webviewsettings.set_property("enable-developer-extras", True)
    self.webviewsettings.set_property("enable-html5-database", True)
    self.webviewsettings.set_property("enable-html5-local-storage", True)
    self.webviewsettings.set_property("enable-offline-web-application-cache", True)
    self.webviewsettings.set_property('enable-file-access-from-file-uris', 1)
    self.webview.load_uri(get_media_file('app/index.html'))
    inspector = Inspector(self.webview.get_inspector())

    self.webview.show()

What I'm I doing wrong? any help will be apreciated (:

1 Answer 1

2

This is not related to python, but javascript under webkit. Please see this question on Stack Overflow.

To summarise it, you can't use openDatabase over local web pages, you will need to use a full local server.

You can use SimpleHTTPServer to start a server from python and connect to it using webview.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .