Permalink
Browse files

Now you can open links from iframes

  • Loading branch information...
1 parent e56c8ce commit 1cb41964de85b0645326dce53123e2c0be1d6aa5 @astagi astagi committed May 19, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 turpial/ui/gtk/htmlview.py
@@ -41,10 +41,16 @@ def __init__(self, coding='utf-8'):
self.view = webkit.WebView()
self.view.set_settings(self.settings)
+
+ #Added new properties in this way cause 'from' is recognized as a key word
+ self.view.get_settings().set_property('enable-universal-access-from-file-uris', True)
+ self.view.get_settings().set_property('enable-file-access-from-file-uris', True)
+
self.view.connect('load-started', self.__started)
self.view.connect('load-finished', self.__finished)
self.view.connect('console-message', self.__console_message)
self.view.connect('navigation-policy-decision-requested', self.__process)
+ self.view.connect('new-window-policy-decision-requested', self.__on_new_window_requested);
scroll = gtk.ScrolledWindow()
scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
@@ -53,6 +59,9 @@ def __init__(self, coding='utf-8'):
self.pack_start(scroll, True, True, 0)
+ def __on_new_window_requested(self, view, frame, request, decision, u_data):
+ self.emit('link-request', request.get_uri())
+
def __console_message(self, view, message, line, source_id, data=None):
print "%s <%s:%i>" % (message, source_id, line)
return True

0 comments on commit 1cb4196

Please sign in to comment.