Esempio n. 1
0
def _set_global_render_settings(js_disable_cross_domain_access):
    from PyQt4.QtWebKit import QWebSecurityOrigin
    if js_disable_cross_domain_access is False:
        # In order to enable cross domain requests it is necessary to add
        # the http and https to the local scheme, this way all the urls are
        # seen as inside the same security origin.
        for scheme in ['http', 'https']:
            QWebSecurityOrigin.addLocalScheme(scheme)
Esempio n. 2
0
def _set_global_render_settings(js_disable_cross_domain_access):
    from PyQt4.QtWebKit import QWebSecurityOrigin
    if js_disable_cross_domain_access is False:
        # In order to enable cross domain requests it is necessary to add
        # the http and https to the local scheme, this way all the urls are
        # seen as inside the same security origin.
        for scheme in ['http', 'https']:
            QWebSecurityOrigin.addLocalScheme(scheme)
Esempio n. 3
0
def _set_global_render_settings(js_disable_cross_domain_access, private_mode):
    from PyQt4.QtWebKit import QWebSecurityOrigin, QWebSettings
    if js_disable_cross_domain_access is False:
        # In order to enable cross domain requests it is necessary to add
        # the http and https to the local scheme, this way all the urls are
        # seen as inside the same security origin.
        for scheme in ['http', 'https']:
            QWebSecurityOrigin.addLocalScheme(scheme)

    settings = QWebSettings.globalSettings()
    settings.setAttribute(QWebSettings.PrivateBrowsingEnabled, private_mode)
    settings.setAttribute(QWebSettings.LocalStorageEnabled, not private_mode)