Re: [Sugar-devel] Web activities on XO-4

2013-09-24 Thread Gonzalo Odiard
Thanks James.

In other news, I have tried add a simple web server,
but apparently I couldn't make run webkit and the webserver together,
even using threads.

Gonzalo


On Thu, Sep 19, 2013 at 7:46 PM, James Cameron qu...@laptop.org wrote:

 I just love sockets.

 But that seems wrong to me; to open a socket to get a port number and
 then shut it down.  Presumably later code would open another socket
 and bind it to the port?

 If you truly need to do it that way, there's one more thing to add
 before the call to bind():

 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

 This is so that the same port number can be re-used shortly
 afterwards.  Otherwise the later code would see an address in use
 error.

 On Thu, Sep 19, 2013 at 08:56:31AM -0300, Gonzalo Odiard wrote:
  A free port can be get using:
 
  # Get a free socket
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
  sock.bind(('', 0))
  sock.listen(socket.SOMAXCONN)
  _ipaddr, self.port = sock.getsockname()
  sock.shutdown(socket.SHUT_RDWR)
  logging.error('Using port %d', self.port)
 
  Should be good use 0.0.0.0 as ip instead of localhost, to avoid [1]
  To serve the files python already have HTTPServer.
 
   Gonzalo
 
  [1] http://dev.laptop.org/ticket/12479
 
 
  On Wed, Sep 18, 2013 at 9:39 PM, Daniel Narvaez dwnarv...@gmail.com
 wrote:
 
  Just a directory. It needs to be one server per activity though, so
 that
  the different port gives us a different origin.
 
 
  On 18 September 2013 23:32, Gonzalo Odiard gonz...@laptop.org
 wrote:
 
  Ok. Thanks.
  The web server need have something special or just serve a
 directory is
  enough?
 
  Gonzalo
 
 
  On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez 
 dwnarv...@gmail.com
  wrote:
 
  Well, there are several html features which depend on each
 activity
  having their own origin, for example local storage.
 
 
  On Wednesday, 18 September 2013, Gonzalo Odiard wrote:
 
  No, why is needed use a local web server instead of
   the use of the proposed solution (use '
  enable-file-access-from-file-uris' )
 
  Gonzalo
 
 
  On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez 
  dwnarv...@gmail.com wrote:
 
  You mean why the http server would be a problem?
 
 
  On Wednesday, 18 September 2013, Gonzalo Odiard
 wrote:
 
  This is for the potential security risk of
 opening
  files outside of the activity directory,
  or because can be a problem with different
 activities
  running at the same time
  or multiple instances of the same activity?
 
  Gonzalo
 
 
  On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez 
  dwnarv...@gmail.com wrote:
 
  You could put an http server in the
 activity...
  Sucks but I'm not sure there is a better way
 :/
 
 
  On Wednesday, 18 September 2013, Manuel
 Quiñones
  wrote:
 
  I finally got web activities working on
 XO-4,
  in the AU build
  published yesterday [1] .  I did it by
  modifying webactivities.py to
  use WebKitGTK1 instead of v2.  The
 changes are:
 
 
 https://github.com/manuq/sugar-toolkit-gtk3-1/
  compare/webacts-webkit1
 
  I tried it with Gears Activity v3, and is
  working.  It stores the data
  and the metadata.  So it is
 communicating with
  the shell just fine.
 
  The touchscreen is not responding very
 well, at
  least in this
  activity.  I can tap buttons, but I can
 barely
  drag to move a gear or
  to draw one.  The dragging seems to be
  cancelled in the middle of the
  action.  Mouse input works fine.
 
  Also as expected, the icons look small
 in the
  XO screen because I need
  to adapt the theme.  But that is an easy
 one,
  just changing the
  CEL_SIZE variable in the LESS file to
 create

Re: [Sugar-devel] Web activities on XO-4

2013-09-24 Thread James Cameron
You don't describe the symptom, but my guess is that an event handler
of WebKit stalls expecting a response from the HTTP server, and a
response will not occur because the HTTP server event handler is not
run.  I speculate that the WebKit event handler may be doing a
blocking connect.

Threads is just another form of event loop, in my opinion.  ;-)

So instead, use a subprocess.  See import subprocess.

On Tue, Sep 24, 2013 at 03:45:46PM -0300, Gonzalo Odiard wrote:
 Thanks James.
 
 In other news, I have tried add a simple web server,
 but apparently I couldn't make run webkit and the webserver together,
 even using threads.
 
 Gonzalo
 
 
 On Thu, Sep 19, 2013 at 7:46 PM, James Cameron qu...@laptop.org wrote:
 
 I just love sockets.
 
 But that seems wrong to me; to open a socket to get a port number and
 then shut it down.  Presumably later code would open another socket
 and bind it to the port?
 
 If you truly need to do it that way, there's one more thing to add
 before the call to bind():
 
         sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
 
 This is so that the same port number can be re-used shortly
 afterwards.  Otherwise the later code would see an address in use
 error.
 
 On Thu, Sep 19, 2013 at 08:56:31AM -0300, Gonzalo Odiard wrote:
  A free port can be get using:
 
              # Get a free socket
              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
              sock.bind(('', 0))
              sock.listen(socket.SOMAXCONN)
              _ipaddr, self.port = sock.getsockname()
              sock.shutdown(socket.SHUT_RDWR)
              logging.error('Using port %d', self.port)
 
  Should be good use 0.0.0.0 as ip instead of localhost, to avoid [1]
  To serve the files python already have HTTPServer.
 
   Gonzalo
 
  [1] http://dev.laptop.org/ticket/12479 
 
 
  On Wed, Sep 18, 2013 at 9:39 PM, Daniel Narvaez dwnarv...@gmail.com
 wrote:
 
      Just a directory. It needs to be one server per activity though, so
 that
      the different port gives us a different origin.
 
 
      On 18 September 2013 23:32, Gonzalo Odiard gonz...@laptop.org
 wrote:
 
          Ok. Thanks.
          The web server need have something special or just serve a
 directory is
          enough? 
 
          Gonzalo
 
 
          On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez 
 dwnarv...@gmail.com
          wrote:
 
              Well, there are several html features which depend on each
 activity
              having their own origin, for example local storage.
 
 
              On Wednesday, 18 September 2013, Gonzalo Odiard wrote:
 
                  No, why is needed use a local web server instead of
                   the use of the proposed solution (use '
                  enable-file-access-from-file-uris' )
 
                  Gonzalo
 
 
                  On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez 
                  dwnarv...@gmail.com wrote:
 
                      You mean why the http server would be a problem?
 
 
                      On Wednesday, 18 September 2013, Gonzalo Odiard
 wrote:
 
                          This is for the potential security risk of
 opening
                          files outside of the activity directory,
                          or because can be a problem with different
 activities
                          running at the same time
                          or multiple instances of the same activity?
 
                          Gonzalo
 
 
                          On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez 
 
                          dwnarv...@gmail.com wrote:
 
                              You could put an http server in the
 activity...
                              Sucks but I'm not sure there is a better way
 :/
 
 
                              On Wednesday, 18 September 2013, Manuel
 Quiñones
                              wrote:
 
                                  I finally got web activities working on
 XO-4,
                                  in the AU build
                                  published yesterday [1] .  I did it by
                                  modifying webactivities.py to
                                  use WebKitGTK1 instead of v2.  The
 changes are:
 
                                  https://github.com/manuq/
 sugar-toolkit-gtk3-1/
                                  compare/webacts-webkit1
 
                                  I tried it with Gears Activity v3, and 
 is
                                  working.  It stores the data
       

Re: [Sugar-devel] Web activities on XO-4

2013-09-19 Thread Gonzalo Odiard
A free port can be get using:

# Get a free socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sock.bind(('', 0))
sock.listen(socket.SOMAXCONN)
_ipaddr, self.port = sock.getsockname()
sock.shutdown(socket.SHUT_RDWR)
logging.error('Using port %d', self.port)

Should be good use 0.0.0.0 as ip instead of localhost, to avoid [1]
To serve the files python already have HTTPServer.

 Gonzalo

[1] http://dev.laptop.org/ticket/12479


On Wed, Sep 18, 2013 at 9:39 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 Just a directory. It needs to be one server per activity though, so that
 the different port gives us a different origin.


 On 18 September 2013 23:32, Gonzalo Odiard gonz...@laptop.org wrote:

 Ok. Thanks.
 The web server need have something special or just serve a directory is
 enough?

 Gonzalo


 On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 Well, there are several html features which depend on each activity
 having their own origin, for example local storage.


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 No, why is needed use a local web server instead of
  the use of the proposed solution (use 'enable-file-access-from-file-
 uris' )

 Gonzalo


 On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 You mean why the http server would be a problem?


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

  This is for the potential security risk of opening files outside of
 the activity directory,
 or because can be a problem with different activities running at the
 same time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez 
 dwnarv...@gmail.comwrote:

 You could put an http server in the activity... Sucks but I'm not
 sure there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:


 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the
 data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear
 or
 to draw one.  The dragging seems to be cancelled in the middle of
 the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I
 need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is
 happening.
 Surprisingly, JavaScript console logs go to the activity log.  We
 are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so
 I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Daniel Narvaez




 --
 Daniel Narvaez





 --
 Daniel Narvaez

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-19 Thread James Cameron
I just love sockets.

But that seems wrong to me; to open a socket to get a port number and
then shut it down.  Presumably later code would open another socket
and bind it to the port?

If you truly need to do it that way, there's one more thing to add
before the call to bind():

sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

This is so that the same port number can be re-used shortly
afterwards.  Otherwise the later code would see an address in use
error.

On Thu, Sep 19, 2013 at 08:56:31AM -0300, Gonzalo Odiard wrote:
 A free port can be get using:
 
             # Get a free socket
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
             sock.bind(('', 0))
             sock.listen(socket.SOMAXCONN)
             _ipaddr, self.port = sock.getsockname()
             sock.shutdown(socket.SHUT_RDWR)
             logging.error('Using port %d', self.port)
 
 Should be good use 0.0.0.0 as ip instead of localhost, to avoid [1]
 To serve the files python already have HTTPServer.
 
  Gonzalo
 
 [1] http://dev.laptop.org/ticket/12479 
 
 
 On Wed, Sep 18, 2013 at 9:39 PM, Daniel Narvaez dwnarv...@gmail.com wrote:
 
 Just a directory. It needs to be one server per activity though, so that
 the different port gives us a different origin.
 
 
 On 18 September 2013 23:32, Gonzalo Odiard gonz...@laptop.org wrote:
 
 Ok. Thanks.
 The web server need have something special or just serve a directory 
 is
 enough? 

 Gonzalo

 
 On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez dwnarv...@gmail.com
 wrote:
 
 Well, there are several html features which depend on each 
 activity
 having their own origin, for example local storage.
 
 
 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:
 
 No, why is needed use a local web server instead of
  the use of the proposed solution (use '
 enable-file-access-from-file-uris' )

 Gonzalo
 
 
 On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez 
 dwnarv...@gmail.com wrote:
 
 You mean why the http server would be a problem?
 
 
 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:
 
 This is for the potential security risk of opening
 files outside of the activity directory,
 or because can be a problem with different activities
 running at the same time
 or multiple instances of the same activity?
 
 Gonzalo
 
 
 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez 
 dwnarv...@gmail.com wrote:
 
 You could put an http server in the activity...
 Sucks but I'm not sure there is a better way :/
 
 
 On Wednesday, 18 September 2013, Manuel Quiñones
 wrote:
 
 I finally got web activities working on XO-4,
 in the AU build
 published yesterday [1] .  I did it by
 modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes 
 are:
 
 https://github.com/manuq/sugar-toolkit-gtk3-1/
 compare/webacts-webkit1
 
 I tried it with Gears Activity v3, and is
 working.  It stores the data
 and the metadata.  So it is communicating with
 the shell just fine.
 
 The touchscreen is not responding very well, 
 at
 least in this
 activity.  I can tap buttons, but I can barely
 drag to move a gear or
 to draw one.  The dragging seems to be
 cancelled in the middle of the
 action.  Mouse input works fine.
 
 Also as expected, the icons look small in the
 XO screen because I need
 to adapt the theme.  But that is an easy one,
 just changing the
 CEL_SIZE variable in the LESS file to create
 another CSS for the XO
 screen DPI, and adding a CSS media query
 selector to the HTML.  I'll
 provide a patch to sugar-web-template and will

[Sugar-devel] Web activities on XO-4

2013-09-18 Thread Manuel Quiñones
I finally got web activities working on XO-4, in the AU build
published yesterday [1] .  I did it by modifying webactivities.py to
use WebKitGTK1 instead of v2.  The changes are:

https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

I tried it with Gears Activity v3, and is working.  It stores the data
and the metadata.  So it is communicating with the shell just fine.

The touchscreen is not responding very well, at least in this
activity.  I can tap buttons, but I can barely drag to move a gear or
to draw one.  The dragging seems to be cancelled in the middle of the
action.  Mouse input works fine.

Also as expected, the icons look small in the XO screen because I need
to adapt the theme.  But that is an easy one, just changing the
CEL_SIZE variable in the LESS file to create another CSS for the XO
screen DPI, and adding a CSS media query selector to the HTML.  I'll
provide a patch to sugar-web-template and will update my web
activities.

The inspector is not working, it does not display.  It shoud display
by Ctrl+Shift+I or by right-click - Inspect element.  There is no
error in the logs and the API is there [2], but nothing is happening.
Surprisingly, JavaScript console logs go to the activity log.  We are
missing that in master.

I managed to keep the activity:// scheme that we need for the
same-origin policy, but I still had to add the setting
'enable-file-access-from-file-uris' to workaround the cross-site
requests.  I can't find a way to register the URI scheme in WK1, so I
added a big FIXME.

[1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
[2] http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Walter Bender
This is great news.

-walter

On Wed, Sep 18, 2013 at 1:01 PM, Manuel Quiñones ma...@laptop.org wrote:
 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2] http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Gonzalo Odiard
Fantastic. Good work!

Gonzalo


On Wed, Sep 18, 2013 at 2:01 PM, Manuel Quiñones ma...@laptop.org wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Daniel Narvaez
Nice work. Did you check that you are actually getting a different origin
in each activity using the new approach to activity://?

On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org javascript:;
 http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Manuel Quiñones
2013/9/18 Daniel Narvaez dwnarv...@gmail.com:
 Nice work. Did you check that you are actually getting a different origin in
 each activity using the new approach to activity://?

Logged document.location.origin, it gives file://, that's why I had to
add the 'enable-file-access-from-file-uris' setting.  What the new
approach does is substitute activity://.. for file://.. when a
resource is requested.

On the other hand, touch works *sometimes*.

-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Daniel Narvaez
You could put an http server in the activity... Sucks but I'm not sure
there is a better way :/

On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org javascript:;
 http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Gonzalo Odiard
This is for the potential security risk of opening files outside of the
activity directory,
or because can be a problem with different activities running at the same
time
or multiple instances of the same activity?

Gonzalo


On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 You could put an http server in the activity... Sucks but I'm not sure
 there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Daniel Narvaez
You mean why the http server would be a problem?

On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 This is for the potential security risk of opening files outside of the
 activity directory,
 or because can be a problem with different activities running at the same
 time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez 
 dwnarv...@gmail.comjavascript:_e({}, 'cvml', 'dwnarv...@gmail.com');
  wrote:

 You could put an http server in the activity... Sucks but I'm not sure
 there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org javascript:_e({}, 'cvml',
 'Sugar-devel@lists.sugarlabs.org');
 http://lists.sugarlabs.org/listinfo/sugar-devel




-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Gonzalo Odiard
No, why is needed use a local web server instead of
 the use of the proposed solution (use 'enable-file-access-from-file-uris' )

Gonzalo


On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 You mean why the http server would be a problem?


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 This is for the potential security risk of opening files outside of the
 activity directory,
 or because can be a problem with different activities running at the same
 time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 You could put an http server in the activity... Sucks but I'm not sure
 there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Daniel Narvaez


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Daniel Narvaez
Well, there are several html features which depend on each activity having
their own origin, for example local storage.

On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 No, why is needed use a local web server instead of
  the use of the proposed solution (use 'enable-file-access-from-file-
 uris' )

 Gonzalo


 On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez 
 dwnarv...@gmail.comjavascript:_e({}, 'cvml', 'dwnarv...@gmail.com');
  wrote:

 You mean why the http server would be a problem?


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

  This is for the potential security risk of opening files outside of the
 activity directory,
 or because can be a problem with different activities running at the
 same time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 You could put an http server in the activity... Sucks but I'm not sure
 there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Daniel Narvaez




-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Gonzalo Odiard
Ok. Thanks.
The web server need have something special or just serve a directory is
enough?

Gonzalo


On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 Well, there are several html features which depend on each activity having
 their own origin, for example local storage.


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 No, why is needed use a local web server instead of
  the use of the proposed solution (use 'enable-file-access-from-file-
 uris' )

 Gonzalo


 On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 You mean why the http server would be a problem?


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

  This is for the potential security risk of opening files outside of
 the activity directory,
 or because can be a problem with different activities running at the
 same time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 You could put an http server in the activity... Sucks but I'm not sure
 there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Daniel Narvaez




 --
 Daniel Narvaez


___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Manuel Quiñones
Yeah, a web server is how this issue is usually overcome.  I was
expecting a proper way but seems that only webkit2 has one, the
register_uri_scheme .

2013/9/18 Gonzalo Odiard gonz...@laptop.org:
 Ok. Thanks.
 The web server need have something special or just serve a directory is
 enough?

 Gonzalo


 On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez dwnarv...@gmail.com wrote:

 Well, there are several html features which depend on each activity having
 their own origin, for example local storage.


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 No, why is needed use a local web server instead of
  the use of the proposed solution (use
 'enable-file-access-from-file-uris' )

 Gonzalo


 On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez dwnarv...@gmail.com
 wrote:

 You mean why the http server would be a problem?


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 This is for the potential security risk of opening files outside of the
 activity directory,
 or because can be a problem with different activities running at the
 same time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez dwnarv...@gmail.com
 wrote:

 You could put an http server in the activity... Sucks but I'm not sure
 there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the
 data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I
 need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Daniel Narvaez




 --
 Daniel Narvaez





-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Daniel Narvaez
Just a directory. It needs to be one server per activity though, so that
the different port gives us a different origin.


On 18 September 2013 23:32, Gonzalo Odiard gonz...@laptop.org wrote:

 Ok. Thanks.
 The web server need have something special or just serve a directory is
 enough?

 Gonzalo


 On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 Well, there are several html features which depend on each activity
 having their own origin, for example local storage.


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

 No, why is needed use a local web server instead of
  the use of the proposed solution (use 'enable-file-access-from-file-
 uris' )

 Gonzalo


 On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez dwnarv...@gmail.comwrote:

 You mean why the http server would be a problem?


 On Wednesday, 18 September 2013, Gonzalo Odiard wrote:

  This is for the potential security risk of opening files outside of
 the activity directory,
 or because can be a problem with different activities running at the
 same time
 or multiple instances of the same activity?

 Gonzalo


 On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez 
 dwnarv...@gmail.comwrote:

 You could put an http server in the activity... Sucks but I'm not
 sure there is a better way :/


 On Wednesday, 18 September 2013, Manuel Quiñones wrote:

 I finally got web activities working on XO-4, in the AU build
 published yesterday [1] .  I did it by modifying webactivities.py to
 use WebKitGTK1 instead of v2.  The changes are:

 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1

 I tried it with Gears Activity v3, and is working.  It stores the
 data
 and the metadata.  So it is communicating with the shell just fine.

 The touchscreen is not responding very well, at least in this
 activity.  I can tap buttons, but I can barely drag to move a gear or
 to draw one.  The dragging seems to be cancelled in the middle of the
 action.  Mouse input works fine.

 Also as expected, the icons look small in the XO screen because I
 need
 to adapt the theme.  But that is an easy one, just changing the
 CEL_SIZE variable in the LESS file to create another CSS for the XO
 screen DPI, and adding a CSS media query selector to the HTML.  I'll
 provide a patch to sugar-web-template and will update my web
 activities.

 The inspector is not working, it does not display.  It shoud display
 by Ctrl+Shift+I or by right-click - Inspect element.  There is no
 error in the logs and the API is there [2], but nothing is happening.
 Surprisingly, JavaScript console logs go to the activity log.  We are
 missing that in master.

 I managed to keep the activity:// scheme that we need for the
 same-origin policy, but I still had to add the setting
 'enable-file-access-from-file-uris' to workaround the cross-site
 requests.  I can't find a way to register the URI scheme in WK1, so I
 added a big FIXME.

 [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
 [2]
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html


 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel



 --
 Daniel Narvaez


 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel




 --
 Daniel Narvaez




 --
 Daniel Narvaez





-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Web activities on XO-4

2013-09-18 Thread Erik Blankinship
Map-2.xo (or thereabouts) had a web server built in.  I don't remember the
specifics, but if someone can dig up the code there might be some ideas in
there.  I recall Dan Williams was helpful in drafting a script for finding
the best available port per activity instance.


On Wed, Sep 18, 2013 at 8:12 PM, Manuel Quiñones ma...@laptop.org wrote:

 Yeah, a web server is how this issue is usually overcome.  I was
 expecting a proper way but seems that only webkit2 has one, the
 register_uri_scheme .

 2013/9/18 Gonzalo Odiard gonz...@laptop.org:
  Ok. Thanks.
  The web server need have something special or just serve a directory is
  enough?
 
  Gonzalo
 
 
  On Wed, Sep 18, 2013 at 6:22 PM, Daniel Narvaez dwnarv...@gmail.com
 wrote:
 
  Well, there are several html features which depend on each activity
 having
  their own origin, for example local storage.
 
 
  On Wednesday, 18 September 2013, Gonzalo Odiard wrote:
 
  No, why is needed use a local web server instead of
   the use of the proposed solution (use
  'enable-file-access-from-file-uris' )
 
  Gonzalo
 
 
  On Wed, Sep 18, 2013 at 6:06 PM, Daniel Narvaez dwnarv...@gmail.com
  wrote:
 
  You mean why the http server would be a problem?
 
 
  On Wednesday, 18 September 2013, Gonzalo Odiard wrote:
 
  This is for the potential security risk of opening files outside of
 the
  activity directory,
  or because can be a problem with different activities running at the
  same time
  or multiple instances of the same activity?
 
  Gonzalo
 
 
  On Wed, Sep 18, 2013 at 5:46 PM, Daniel Narvaez dwnarv...@gmail.com
 
  wrote:
 
  You could put an http server in the activity... Sucks but I'm not
 sure
  there is a better way :/
 
 
  On Wednesday, 18 September 2013, Manuel Quiñones wrote:
 
  I finally got web activities working on XO-4, in the AU build
  published yesterday [1] .  I did it by modifying webactivities.py
 to
  use WebKitGTK1 instead of v2.  The changes are:
 
 
 https://github.com/manuq/sugar-toolkit-gtk3-1/compare/webacts-webkit1
 
  I tried it with Gears Activity v3, and is working.  It stores the
  data
  and the metadata.  So it is communicating with the shell just fine.
 
  The touchscreen is not responding very well, at least in this
  activity.  I can tap buttons, but I can barely drag to move a gear
 or
  to draw one.  The dragging seems to be cancelled in the middle of
 the
  action.  Mouse input works fine.
 
  Also as expected, the icons look small in the XO screen because I
  need
  to adapt the theme.  But that is an easy one, just changing the
  CEL_SIZE variable in the LESS file to create another CSS for the XO
  screen DPI, and adding a CSS media query selector to the HTML.
  I'll
  provide a patch to sugar-web-template and will update my web
  activities.
 
  The inspector is not working, it does not display.  It shoud
 display
  by Ctrl+Shift+I or by right-click - Inspect element.  There is
 no
  error in the logs and the API is there [2], but nothing is
 happening.
  Surprisingly, JavaScript console logs go to the activity log.  We
 are
  missing that in master.
 
  I managed to keep the activity:// scheme that we need for the
  same-origin policy, but I still had to add the setting
  'enable-file-access-from-file-uris' to workaround the cross-site
  requests.  I can't find a way to register the URI scheme in WK1,
 so I
  added a big FIXME.
 
  [1] http://build.laptop.org.au/xo/os/sugar-100/build-21/
  [2]
 
 http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebInspector.html
 
 
  --
  .. manuq ..
  ___
  Sugar-devel mailing list
  Sugar-devel@lists.sugarlabs.org
  http://lists.sugarlabs.org/listinfo/sugar-devel
 
 
 
  --
  Daniel Narvaez
 
 
  ___
  Sugar-devel mailing list
  Sugar-devel@lists.sugarlabs.org
  http://lists.sugarlabs.org/listinfo/sugar-devel
 
 
 
 
  --
  Daniel Narvaez
 
 
 
 
  --
  Daniel Narvaez
 
 



 --
 .. manuq ..
 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel