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

[Bug]: Selecting favorite doesn't work (as intended) for pdf #75

Closed rhl-bthr closed 4 years ago

rhl-bthr commented 6 years ago

Steps to reproduce:

  1. Open Browser
  2. Request a PDF resource from a url
  3. The PDF opens in a new tab
  4. Mark it as favorite (The rest of the toolbar(except StopButton) should be disabled)

Expected result: The link will be marked as favorite and a snap of the same will be added to the bookmark toolbar at the bottom

Observed result: The link is marked as favorite, but the snap doesn't get reflected in the toolbar, only a blank icon is shown. The snap is displayed on stopping and restarting the activity

Logs:

Traceback (most recent call last):
  File "/usr/share/sugar/activities/browse-activity/webactivity.py", line 558, in _add_link_model_cb
    self, self._tabbed_view.props.current_browser, widget))
  File "/usr/share/sugar/activities/browse-activity/webactivity.py", line 731, in __init__
    self._balloc = browser.get_allocation()
AttributeError: 'DummyBrowser' object has no attribute 'get_allocation'
rhl-bthr commented 6 years ago

Note: The cause is the same as #74

Reproduced on: Ubuntu 16.04, Sugar 0.112

nswarup14 commented 5 years ago

On clicking the 'Favorite' button for a regular we page (not a PDF), the following error occurs.

Traceback (most recent call last):
File "/home/radha/sugar-stuff/sugar-activities/browse-activity/webactivity.py", line 409, in __link_add_button_cb
    self._add_link()
  File "/home/radha/sugar-stuff/sugar-activities/browse-activity/webactivity.py", line 512, in _add_link
    buf = b64encode(self._get_screenshot())
  File "/home/radha/sugar-stuff/sugar-activities/browse-activity/webactivity.py", line 617, in _get_screenshot
    thumb_surface.write_to_png(thumb_str)
webactivity.IOError: error while writing to output stream

Tested on Ubuntu 18.04 Sugar v0.114

quozl commented 5 years ago

On clicking the 'Favorite' button [...] error occurs.

Fixed in fc288b64168629deb23b755c0712eb02604c144e.

Reproduced the issue #75.

quozl commented 4 years ago

8c66ce05fba927879fef6bca86e37be497ab04a5