Giter VIP home page Giter VIP logo

browse-activity's Introduction

What is this?

Browse is a web browser activity for the Sugar desktop.

How to use?

Browse is part of the Sugar desktop and is always included. Please refer to;

How to upgrade?

On Sugar desktop systems;

How to integrate?

On Debian and Ubuntu systems;

apt install sugar-browse-activity

On Fedora systems;

dnf install sugar-browse

Browse depends on Python, Sugar Toolkit, D-Bus, Cairo, Telepathy, GTK+ 3, Pango, Rsvg, Soup, Evince and WebKit. Unusually, Browse also depends on glib-compile-schemas to compile a Gio.Settings schema.

Browse is started by Sugar.

Browse is packaged by Linux distributions;

How to develop?

  • setup a development environment for Sugar desktop,
  • clone this repository,
  • edit source files,
  • test in Terminal by typing sugar-activity3

APIs

Code inside Browse depends on several APIs, including;

Branch master

The master branch targets an environment with latest stable release of Sugar, with dependencies on latest stable release of Fedora and Debian distributions.

Release tags are v204 and higher.

Branch python2

The python2 branch is a backport of features and bug fixes from the master branch for ongoing maintenance of the activity on Ubuntu 16.04 and Ubuntu 18.04 systems which don't have a Python 3 capable release of Sugar.

Release tags are v203.2 and higher, but lower than v204.

Branch not-webkit2

The not-webkit2 branch is a backport of features and bug fixes from the master branch for ongoing maintenance of the activity on Fedora 18 systems which don't have well-functioning WebKit2 packages.

Release tags are v157.5 and higher, but lower than v200.

browse-activity's People

Contributors

aniket21mathur avatar avinashbharti97 avatar chimosky avatar dcbw avatar dimi20cen avatar erikos avatar gauravp94 avatar godiard avatar goutamnair7 avatar humitos avatar i5o avatar iamutkarshtiwari avatar jirwin avatar korakurider avatar leonardcj avatar lucian1900 avatar marsian83 avatar nswarup14 avatar pootle-sugarlabs avatar quozl avatar rbuj avatar rhl-bthr avatar samdroid-apps avatar saumya-mishra9129 avatar shaansubbaiah avatar silbe avatar smcv avatar srevinsaju avatar tomeuv avatar vipulgupta2048 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browse-activity's Issues

Enhance browser homepage

screenshot 2019-02-02 at 4 48 40 pm

In the current browser homepage text space and search button seems too small, creating constrains of having a good space to type and good button size to click on with ease.

I,

  • Increased the size of the text space
  • Increased the size of the 'google search' button
  • Change the colour of the button
  • Centralised the logo, text space and button, to maintain a better use of white spacing
  • Added a console, so once you're on you don't need to click first before typing... just start typing

browse

Delete activity bundle after download and install

Reproducer:

  • download an activity bundle from activities.sugarlabs.org or wiki.laptop.org,

Observed result:

  • activity bundle is both installed and left in journal

Expected result:

  • activity bundle is installed and not left in journal.

View source not yet ported to WebKit2

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.

get_session_state

I'm testing webkit2 branch, and I found the following excpeption.

File "/usr/share/sugar/activities/Browse.activity/webactivity.py", line 492, in write_file
self._tabbed_view.get_state()
File "/usr/share/sugar/activities/Browse.activity/browser.py", line 464, in get_state
'state': tab_page.browser.get_state()})
File "/usr/share/sugar/activities/Browse.activity/browser.py", line 700, in get_state
state = self.get_session_state()
AttributeError: 'Browser' object has no attribute 'get_session_state'

Attached you can find the log file.
org.laptop.WebActivity-1.txt

Gtk-WARNING: Failed to set text from markup

Logs contain

(sugar-activity:1376): Gtk-WARNING **: 15:41:06.295: Failed to set text from
markup due to error parsing markup: Error on line 2: Entity did not end with a
semicolon; most likely you used an ampersand character without intending to
start an entity - escape ampersand as &

No visible effect noted.

  • use debugging or GTK environment variables to isolate to cause (a line number, obviously not in sugar-activity),
  • fix the problem.

For anyone interested in working on it.

Fail to search in PDF

Reproducer: click on a PDF, open the edit toolbar, click on the search entry, type a word to search for.

Expected result: words searched for and highlighted.

Observed result: nothing seen, except for logs;

Traceback (most recent call last):
  File "/usr/share/sugar/activities/Browse.activity/edittoolbar.py", line 159, in __search_entry_changed_cb
    self._find_and_mark_text(entry)
  File "/usr/share/sugar/activities/Browse.activity/edittoolbar.py", line 149, in _find_and_mark_text
    controller = self._browser.get_find_controller()
AttributeError: 'DummyBrowser' object has no attribute 'get_find_controller'

[Bug]: DummyBrowser Instance is treated same way as Browser

Steps to Reproduce:

  1. Request a PDF resource from a URL
  2. The pdf opens in a new tab

Logs:
AttributeError: DummyBrowser object has no attribute can-go-back

Reason:
DummyBrowser (GObject.GObject) doesn't have all the attributes of Browser (Webkit2.View)

Search in address bar is redirecting to website's search plugin

Subject of the Issue
On visiting https://www.sugarlabs.org using Browse-activity and then using the Address bar if any keyword search is performed then the address redirects to website's search plugin instead of normal google search.

Test Environment

  • Sucrose on ubuntu 18.04

Steps to reproduce

Expected Behaviour

  • On searching any keyword from address bar it should redirect to google search

Actual Behaviour

  • Keyword search redirects to website's search plugin.

lost mime type on downloads from activities.sugarlabs.org

Reproducer:

  • click on activities,
  • download an activity,
  • view in journal,
  • switch to detail view,
  • examine mime type "Kind" and try to open the entry.

Expected result:

  • application/vnd.olpc-sugar
  • activity is installed and runs

Observed result:

  • application/octet-stream
  • No activity to start entry

Versions: Affects Browse-200. Browse-157 works fine.

Impact: critical, as it breaks activities.sugarlabs.org for current version of Browse in Ubuntu, Debian, Raspbian and Fedora.

Reported by @Rishabh42.

Add README file

Adding readme file will help others to understand the project, what is there in the project and how to use it.

[Feature]: 'download complete' should replace 'download started' on completion

Steps to reproduce:

  • Open a webpage
  • Download a file (small enough to be download in ~5 sec)

Observed Result:

  • download started alert is present even after download completed

Proposed Result:

  • download started should be replaced by Download completed on completion
  • as implemented in 19c0ad7

Kindly review this issue, since I am unaware if the present implementation was intentional

Tab title stays "Loading..." when a download starts

Browser tab titles are set from page content, and when a resource is being loaded they are set to "Loading..."

When a resource load switches to a download the title is left as "Loading..." but should instead switch back to the title it had before.

ImportError: No module named collabwrapper

Just installed a clean sugar on a debian:testing, but the browser is not launching. In ~/.sugar/default/logs/org.laptop.WebActivity-X.log it says:

/usr/share/sugar/activities/Browse.activity/webactivity.py:27: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
/usr/share/sugar/activities/Browse.activity/webactivity.py:29: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import WebKit2
/usr/share/sugar/activities/Browse.activity/webactivity.py:31: PyGIWarning: SoupGNOME was imported without specifying a version first. Use gi.require_version('SoupGNOME', '2.4') before import to ensure that the right version gets loaded.
  from gi.repository import SoupGNOME
/usr/share/sugar/activities/Browse.activity/webactivity.py:37: PyGIWarning: GConf was imported without specifying a version first. Use gi.require_version('GConf', '2.0') before import to ensure that the right version gets loaded.
  from gi.repository import GConf
Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 220, in <module>
    main()
  File "/usr/bin/sugar-activity", line 164, in main
    module = __import__(module_name)
  File "/usr/share/sugar/activities/Browse.activity/webactivity.py", line 53, in <module>
    from collabwrapper.collabwrapper import CollabWrapper
ImportError: No module named collabwrapper
Exited with status 1, pid 7714 data (<open file '<fdopen>', mode 'w' at 0xadd32a70>, dbus.ByteArray('2910a1292e68108c668a90221c42d5a4630bbde9', variant_level=1))

The file /usr/share/sugar/activities/Browse.activity/collabwrapper/collabwrapper.py exists and if I just link it into the Browse.activity directory (same file w/o additional directory):

ln -s /XXX/Browse.activity/collabwrapper/collabwrapper.py /XXX/Browse.activity/collabwrapper.py

and modify the import in

from collabwrapper.collabwrapper import CollabWrapper
to be:

from collabwrapper import CollabWrapper

It works like a charm. I'm not a python expert and have no idea what that means, but maybe you know?

Every PDF is downloaded twice

In browser.py __decide_policy_cb when the MIME Type is application/pdf the in-progress or completed GET request is abandoned and a second GET request is made by the PDF viewer.

This uses more internet bandwidth and causes double-counting in server logs.

Activity not launching/working in sugar-build.

Using sugar-build (latest one! :P) I get

Traceback (most recent call last):
  File "/home/broot/sugar-build/build/out/install/bin/sugar-activity", line 220, in <module>
    main()
  File "/home/broot/sugar-build/build/out/install/bin/sugar-activity", line 164, in main
    module = __import__(module_name)
  File "/home/broot/sugar-build/build/out/install/share/sugar/activities/Browse.activity/webactivity.py", line 53, in <module>
    from widgets import TitledTray
  File "/home/broot/sugar-build/build/out/install/share/sugar/activities/Browse.activity/widgets.py", line 109, in <module>
    css_provider.load_from_data(css)
gi._glib.GError: <data>:7:14'min-height' is not a valid property name
Exited with status 1, pid 29998 data (<open file '<fdopen>', mode 'w' at 0xab81de0>, '8d463c472337246bd4f6134416a1aee8a667ea88')

Maybe it works on fedora rawhide, or smh. But we should provide support to sugar-build on debian or similars.

We are leaking something

There might be a leak somewhere. 2 ways this is visible:

  1. Do normal browsing for 10 minutes. After about 10 minutes, switching between tabs will result in a grey screen for ~5 sec and the browser becoming laggy. The toolbar (the Sugar stuff) is still responsive, but all of the web views are terrible.
  2. Open a video (eg. https://www.youtube.com/watch?v=SYRlTISvjww). Press play. Hear the song for a little bit. Close the tab. The song will continue playing for a very long time (~30sec on my last trial, but I swear I have seen longer before). Are we not destroying the tabs when we close them? What is happening?

The tab crashes when the embedded video is played in the browser.

log of browser-activity

1616407200.059666 ERROR root: WebKit2 WebView at uri 'https://www.youtube.com/' has crashed
1616407240.945007 ERROR root: WebKit2 WebView at uri 'https://www.google.com/intl/en_in/earth/' has crashed
1616409426.245211 ERROR root: WebKit2 WebView at uri 'https://github.com/' has crashed
Traceback (most recent call last):
  File "../Activities/Browse.activity/browser.py", line 319, in __crashed_cb
    self.close_tab(browser.get_parent())
  File "../Activities/Browse.activity/browser.py", line 390, in close_tab
    tab_page.props.browser.destroy()
AttributeError: 'gi._gi.GProps' object has no attribute 'browser'
Normal successful completion, pid 55637 activity_id 34a3b6c4906ee27d31fac4619bdfe9eaaaebceaf

Reproduce:

  1. Open browser-activity, type www.youtube.com and play a video. (or)
  2. Search something(on Google) that shows video suggestions and hover the cursor over it for a bit. (or)
  3. Open a web page with heavy graphics (homepage of GitHub) and scroll down half way.

Browser-tab crashes

Browse does not handle the new user media permission requests

On Ubuntu 18.04 with Browse 7cfd9f2 and v202, scratch.mit.edu online editor v3.0 does play sound fine, but does not record sound. When an attempt is made, a dialog from the web app is shown, but it is insensitive. There is no WebKit2.UserMediaPermissionRequest sent. Console shows an internationalisation error in the web app;

projects.bundle.js:68:13595
Unhandled Promise Rejection:
Invariant Violation: 
[React Intl] An `id` must be provided to format a message

screenshot_ubb_2019-01-12_09 10 01

Reproducer:

  • start Browse, open https://scratch.mit.edu/, click on Create, await loading,
  • click on Sound (purple circle),
  • click on Meow in play sound, and select Record ...

Attemping to bisect by wrapper, MiniBrowser from libwebkit2gtk-4.0-37 does not render the editor at all.

Works fine with Firefox, which pops up a permission request at this time. If the permission request is refused, the editor remains in the same state as shown by the screenshot above.

https://www.html5rocks.com/en/tutorials/getusermedia/intro references an audio record demonstration at http://webaudiodemos.appspot.com/AudioRecorder/index.html which likewise does not work.

So the cause is a failure to receive and handle the permission request.

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

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'

AttributeError: 'DummyBrowser' object has no attribute 'can_execute_editing_command_finish'

Traceback (most recent call last):
  File "/usr/share/sugar/activities/Browse.activity/edittoolbar.py", line 130, in __can_execute_editing_command_cb
    can = self._browser.can_execute_editing_command_finish(result)
AttributeError: 'DummyBrowser' object has no attribute 'can_execute_editing_command_finish'

Possible reproducer: start Browse, enter a URL of a PDF document, switch between default tab and the PDF tab repeatedly.

WebKit2 is terribly slow with keyboard input

Tested on the login form of gmail and my school's LMS

When you type, there is a huge lag between you pressing the key and it being entered. Everything looks like it has the slow type effect going - all the key presses are spaced out 500ms.

The rest of the ui (eg. mousing over a dropdown menu in the LMS site) is very snappy. But not the typing. Is this our fault or is it a webkit bug?

image download in python3 port of browse-activity

Due to a bug in the preview generation, image download is currently broken in master (the python3) version. Issue is using io.StringIO, where io.BytesIO should be used. A preview is being generated, but size of image in preview is small. That's due to another issue though, haven't debugged that yet.

below patch fixes the download issue for me. Tested with python3 (2 not revelant, as master is for python3 only, right?) and download of images works again.

best regards,
Bas Hulsken

--- sugar-browse/downloadmanager.py     2019-07-10 10:04:22.406146703 +0200
+++ sugar-browse-fix/downloadmanager.py 2020-01-04 14:51:31.428367923 +0100
@@ -406,7 +406,7 @@ class Download(object):
         Gdk.cairo_set_source_pixbuf(cr, pixbuf, 0, 0)
         cr.paint()

-        preview_str = io.StringIO()
+        preview_str = io.BytesIO()
         preview_surface.write_to_png(preview_str)
         return preview_str.getvalue()

Develop offered for activity bundle open

When the Develop activity is present, and a bundle is downloaded, Browse offers to open the bundle in Develop. It should instead offer to run the downloaded activity.

RPi: Fails to start on a raspberry pi

Browser activity fails to start on Raspberry Pi

  • v207 gets installed instead of v208 after installing sucrose apt package. (I don't know whom to ping for apt)

    apt show sugar-browse-activity returns
    Package: sugar-browse-activity
    Version: 207-2

    v207 has rendering issues but we can ignore this and focus on v208:
    (will upload a screenshot soon)

  • after updating, v208 (latest as of now) returns:

    Traceback (most recent call last): File "/usr/bin/sugar-activity3", line 5, in <module> activityinstance.main() File "/usr/lib/python3/dist-packages/sugar3/activity/activityinstance.py", line 179, in main module = import(module_name) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/Activities/browse-activity/webactivity.py", line 31, in <module> gi.require_version('Soup', '3.0') File "/usr/lib/python3/dist-packages/gi/init.py", line 129, in require_version raise ValueError('Namespace %s not available for version %s' % ValueError: Namespace Soup not available for version 3.0

To summarize, there are 2 issues:

  • Installing sucrose from apt, installs the old version (v207) which is "buggy"
  • v208 returns an error stating Soup 3.0 is missing

Browser Fails to run on RPi.

Shell.log output is as follows :-

(metacity:911): metacity-WARNING **: 16:47:00.973: Option “--no-composite” is deprecated, use the “--compositor” instead.
1708106912.260464 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708107106.669935 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708118045.395503 WARNING root: no data for selection target MULTIPLE.
1708118045.433662 WARNING root: no data for selection target NULL.
1708118200.370356 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708118326.579868 WARNING root: no data for selection target MULTIPLE.
1708118326.752622 WARNING root: no data for selection target NULL.
1708118331.591342 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
1708123067.050076 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
1708123100.975382 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
(metacity:911): metacity-WARNING **: 23:58:16.588: last_user_time (1708127896) is greater than comparison timestamp (25927958). This most likely represents a buggy client sending inaccurate timestamps in messages such as _NET_ACTIVE_WINDOW. Trying to work around...
(metacity:911): metacity-WARNING **: 23:58:16.589: 0xe00008 (Chat Activity) appears to be one of the offending windows with a timestamp of 1708127896. Working around...
1708128011.038285 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
1708128503.737323 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708128648.528195 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708128662.573229 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
1708130354.515040 ERROR root: set_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708130769.544480 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
1708130825.498344 ERROR root: set\_active() failed: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708130941.984615 WARNING root: no data for selection target MULTIPLE.
1708130942.029909 WARNING root: no data for selection target NULL.
1708131067.593885 WARNING root: no data for selection target MULTIPLE.
1708131067.625198 WARNING root: no data for selection target NULL.
1708131210.831571 ERROR dbus.proxies: Introspect error on :1.101:/org/laptop/Activity/e9cbd28d293d0bef922990befae41d91f7f10aa3:` dbus.exceptions.DBusException:``org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708131210.851485 ERROR root: set\_active() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.101 was not provided by any .service files
1708131254.315188 ERROR root: set\_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist
1708131293.058005 ERROR dbus.proxies: Introspect error on :1.107:/org/laptop/Activity/30d6414cd2e3af6f61fc469617f922687ce2232b: dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708131293.074493 ERROR root: set_active() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.107 was not provided by any .service files
1708131304.239895 ERROR dbus.proxies: Introspect error on :1.111:/org/laptop/Activity/e17c417cb583eba9a7c5bfc064c75ccb38d27c88: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
1708131304.265103 ERROR root: set_active() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.111 was not provided by any .service files
1708131457.239108 ERROR root: set_active() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "SetActive" with signature "v" on interface "org.laptop.Activity" doesn't exist

Fail to start using `sugar-activity` in Terminal

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 219, in <module>
    main()
  File "/usr/bin/sugar-activity", line 214, in main
    instance = create_activity_instance(activity_constructor, activity_handle)
  File "/usr/bin/sugar-activity", line 48, in create_activity_instance
    activity = constructor(handle)
  File "/usr/share/sugar/activities/Browse.activity/webactivity.py", line 192, in __init__
    self._tabbed_view = TabbedView(self)
  File "/usr/share/sugar/activities/Browse.activity/browser.py", line 133, in __init__
    self.settings = _get_local_settings(activity)
  File "/usr/share/sugar/activities/Browse.activity/browser.py", line 117, in _get_local_settings
    _settings = Gio.Settings.new_full(schema, None, None)
TypeError: Argument 0 does not allow None as a value
Segmentation fault (core dumped)

May be caused by environment variables inherited from Terminal, which would mean the fix may also be done to Terminal.

Workaround: start from Sugar home view.

broken stop button

It seems that the stop button is broken - related code contains what seems to be a typo (missing "E"):

if web_error.code == WebKit2.NetworkError.CANCLLED:

NB! I have not tested if code works or not, only noticed by skimming through source commits.

Homepage file:// URL is downloaded (not shown)

When starting Browse activity 200, default homepage URL gets downloaded, not rendered.

NB! I am testing Debian soon-to-be-in-unstable Browse package with only-in-unstable Sugar packages, so there is a real risk that I have missed some dependencies or broken something in the process of repackaging.

Add dark mode for PDFs

Evince has an Inverted Colours toggle in the File options with a shortcut of ctrl+i. Add the same shortcut to invert colours when viewing a PDF with Browse.

Sometimes fails to download and show PDF

1568155200.231043 ERROR root: FINISHED file:///home/guest/Downloads/Carolyn_FINAL_DRAFT_OWL_1_.pdf
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Browse.activity/pdfviewer.py", line 555, in __download_finished_cb
    self._show_pdf()
  File "/usr/share/sugar/activities/Browse.activity/pdfviewer.py", line 482, in _show_pdf
    self._evince_viewer = EvinceViewer(self._pdf_uri)
  File "/usr/share/sugar/activities/Browse.activity/pdfviewer.py", line 66, in __init__
    self._doc = EvinceDocument.Document.factory_get_document(uri)
gi.repository.GLib.Error: g-io-error-quark: Error opening file /home/guest/Downloads/Carolyn_FINAL_DRAFT_OWL_1_.pdf: No such file or directory (1)
1568155200.236871 ERROR root: FINISHED file:///home/guest/Downloads/Carolyn_FINAL_DRAFT_OWL_1_.pdf

URL was
https://wiki.sugarlabs.org/go/File:Carolyn_FINAL_DRAFT_OWL_1_.pdf
which contains link to a PDF
https://wiki.sugarlabs.org/images/b/b0/Carolyn_FINAL_DRAFT_OWL_1_.pdf

general license wrong: some parts are licensed as GPL-3+

General license - e.g. in metadata for Github - is GPL-2+, but some parts (progresstoolbutton.py) is GPL-3+ - i.e. is incompatible with the overall license.

I believe you should adjust the metadata llicense to reflect not the most common license used (GPL-2+) but instead the effective license that all code is licensed to migrate to: GPL-3+.

HTTPError not handled while trying to copy an image.

Sometimes an error is thrown while trying to copy an image.

Reproduce:
right click -> copy image

Tested on:
Sugar 0.117-3, Debian Bullseye
Sugar 0.117, Sugar Live Build

Errors appear while trying on Google Images, but worked without issues on the same image later.
Not sure how to reproduce this accurately.

# Sugar 0.117-3, Debian Bullseye

1593790508.439674 DEBUG root: ActivityService.set_active: 1.
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Browse.activity/palettes.py", line 248, in __copy_image_activate_cb
    data = urllib.request.urlopen(self._image_url).read()
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
# Sugar 0.117, Sugar Live Build

** (sugar-activity3:20758): CRITICAL **: 09:12:49.385: gboolean webkit_web_view_can_execut
e_editing_command_finish(WebKitWebView*, GAsyncResult*, GError**): assertion 'g_task_is_valid(result, webView)' failed
failed to create drawable
Traceback (most recent call last):
  File "/usr/src/sugar-activities/Browse.activity/palettes.py", line 248, in __copy_image_
activate_cb
    data = urllib.request.urlopen(self._image_url).read()
  File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.