sugarlabs / browse-activity

Sugar activity to browse the internet; WebKit on GTK on Sugar Toolkit
GNU General Public License v2.0
8 stars 44 forks source link

View source not yet ported to WebKit2 #57

Closed quozl closed 7 years ago

quozl commented 7 years ago

Reproducer: start Browse 201.2, show Frame, right-click on Browse icon, click on View Source.

Expected result: source of activity and page source.

Observed result: source of activity only, and an error message in logs;

1501544044.469634 ERROR root: Exception occured in GetDocumentPath():
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/jarabe/view/viewsource.py", line 146, in setup_view_source
    document_path = service.GetDocumentPath()
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/sugar3/activity/activityservice.py", line 81, in GetDocumentPath
    self._activity.get_document_path(async_cb, async_err_cb)
  File "/usr/share/sugar/activities/Browse.activity/webactivity.py", line 663, in get_document_path
    browser.get_source(async_cb, async_err_cb)
  File "/usr/share/sugar/activities/Browse.activity/browser.py", line 749, in get_source
    data_source = self.get_main_frame().get_data_source()
AttributeError: 'Browser' object has no attribute 'get_main_frame'

Analysis: WebKit2 4.0 API documentation shows get_main_frame is no longer a method of WebView, so it looks like this code has not yet been ported to the API.

p.s. spelling error since fixed; occured should be occurred.