Re: [Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
On 01/23/2012 07:16 PM, Sascha Silbe wrote: Excerpts from Simon Schampijer's message of 2012-01-16 12:52:00 +0100: Furthermore we need to modify the Sugar version in Browse accordingly with each Sugar release as the Sugar version is only availble in the shell and not in the toolkit. As others pointed out (and you obviously noticed yourself), Browse isn't really a good place for this to live. In general we recommend activities to check for certain features [1] in order to run on different versions of Sugar, but we can't pack much information into the User-Agent header, so for this particular use case a way to figure out the Sugar Platform version [2] would be useful. Sascha [1] https://wiki.sugarlabs.org/go/Activity_Team/Compatibility_Tips [2] https://wiki.sugarlabs.org/go/0.96/Platform_Components Can you be more concrete what you recommend? It is hard for me to tell from your comment. Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
Excerpts from Simon Schampijer's message of 2012-01-16 12:52:00 +0100: > Furthermore we need to modify the Sugar version in Browse accordingly > with each Sugar release as the Sugar version is only availble in the > shell and not in the toolkit. As others pointed out (and you obviously noticed yourself), Browse isn't really a good place for this to live. In general we recommend activities to check for certain features [1] in order to run on different versions of Sugar, but we can't pack much information into the User-Agent header, so for this particular use case a way to figure out the Sugar Platform version [2] would be useful. Sascha [1] https://wiki.sugarlabs.org/go/Activity_Team/Compatibility_Tips [2] https://wiki.sugarlabs.org/go/0.96/Platform_Components -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
On 01/23/2012 04:07 PM, Manuel Quiñones wrote: El día 16 de enero de 2012 08:52, Simon Schampijer escribió: This identifier is used in ASLO to determine which activities can be downloaded (ASLO is parsing the user agent of the Browser to provide an appropriate activity version, if it fails to get the Sugar version from the agent string, it uses the last stable version, which is 0.94 at the moment). Tested, previously I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Now I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Sugar Labs/0.96 And works in activities.sugarlabs.org . One thing that is not perfectly handled by this patch is that we need to modify the user agent for every WebView (see [1]). I don't find a problem adding the user agent to each webview, at least until the webkit hackers add a global setting. Furthermore we need to modify the Sugar version in Browse accordingly with each Sugar release as the Sugar version is only availble in the shell and not in the toolkit. I hope the tookit changes accordingly so we don't have to hardcore that in activities. Yeah, maybe we should support that, not 100% sure yet. Acked-by: Manuel Quiñones Thanks for the review, pushed. Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
On 01/23/2012 07:30 AM, Simon Schampijer wrote: On 01/23/2012 04:25 PM, Thomas C Gilliard wrote: On 01/23/2012 07:07 AM, Manuel Quiñones wrote: El día 16 de enero de 2012 08:52, Simon Schampijer escribió: This identifier is used in ASLO to determine which activities can be downloaded (ASLO is parsing the user agent of the Browser to provide an appropriate activity version, if it fails to get the Sugar version from the agent string, it uses the last stable version, which is 0.94 at the moment). Tested, previously I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Now I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Sugar Labs/0.96 And works in activities.sugarlabs.org . Comment: If a user wants to download the activity.xo file to a USB-stick for installation later to a different version of Sugar? Maybe a check-box to bypass the filter on the ASLO page should be added. Tom Gilliard Hi Tom, thanks for the comment. I don't see this as a too common use case to justify adding UI for it. Simon; I am thinking "sneaker-net" where a USB-stick is taken back to a remote location off net to add activities. Maybe downloaded on a computer to the USB-stick with a fast internet connection with a different browser. The alternate is for them to Download and burn: http://wiki.sugarlabs.org/go/Sugar_Creation_Kit#ASLOxo-6 (3.2 GB DVD .iso) which has over 500 sugar activitiy .xo files on it. Regards; Tom Gilliard satellit_ Regards, Simon ___ 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] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
On 01/23/2012 04:25 PM, Thomas C Gilliard wrote: On 01/23/2012 07:07 AM, Manuel Quiñones wrote: El día 16 de enero de 2012 08:52, Simon Schampijer escribió: This identifier is used in ASLO to determine which activities can be downloaded (ASLO is parsing the user agent of the Browser to provide an appropriate activity version, if it fails to get the Sugar version from the agent string, it uses the last stable version, which is 0.94 at the moment). Tested, previously I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Now I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Sugar Labs/0.96 And works in activities.sugarlabs.org . Comment: If a user wants to download the activity.xo file to a USB-stick for installation later to a different version of Sugar? Maybe a check-box to bypass the filter on the ASLO page should be added. Tom Gilliard Hi Tom, thanks for the comment. I don't see this as a too common use case to justify adding UI for it. Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
On 01/23/2012 07:07 AM, Manuel Quiñones wrote: El día 16 de enero de 2012 08:52, Simon Schampijer escribió: This identifier is used in ASLO to determine which activities can be downloaded (ASLO is parsing the user agent of the Browser to provide an appropriate activity version, if it fails to get the Sugar version from the agent string, it uses the last stable version, which is 0.94 at the moment). Tested, previously I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Now I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Sugar Labs/0.96 And works in activities.sugarlabs.org . Comment: If a user wants to download the activity.xo file to a USB-stick for installation later to a different version of Sugar? Maybe a check-box to bypass the filter on the ASLO page should be added. Tom Gilliard One thing that is not perfectly handled by this patch is that we need to modify the user agent for every WebView (see [1]). I don't find a problem adding the user agent to each webview, at least until the webkit hackers add a global setting. Furthermore we need to modify the Sugar version in Browse accordingly with each Sugar release as the Sugar version is only availble in the shell and not in the toolkit. I hope the tookit changes accordingly so we don't have to hardcore that in activities. Acked-by: Manuel Quiñones [1] https://lists.webkit.org/pipermail/webkit-gtk/2012-January/000893.html Signed-off-by: Simon Schampijer --- browser.py |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/browser.py b/browser.py index 83cc7ea..c5165db 100644 --- a/browser.py +++ b/browser.py @@ -383,9 +383,16 @@ class Browser(WebKit.WebView): ([str])), } +CURRENT_SUGAR_VERSION = '0.96' + def __init__(self): WebKit.WebView.__init__(self) +web_settings = self.get_settings() +identifier = ' Sugar Labs/' + self.CURRENT_SUGAR_VERSION +web_settings.props.user_agent += identifier +self.set_settings(web_settings) + # Reference to the global history and callbacks to handle it: self._global_history = globalhistory.get_global_history() self.connect('notify::load-status', self.__load_status_changed_cb) -- 1.7.7.5 ___ 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] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
El día 16 de enero de 2012 08:52, Simon Schampijer escribió: > This identifier is used in ASLO to determine which activities > can be downloaded (ASLO is parsing the user agent of the Browser > to provide an appropriate activity version, if it fails to get > the Sugar version from the agent string, it uses the last stable version, > which is 0.94 at the moment). Tested, previously I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Now I got: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Sugar Labs/0.96 And works in activities.sugarlabs.org . > > One thing that is not perfectly handled by this patch is that we > need to modify the user agent for every WebView (see [1]). I don't find a problem adding the user agent to each webview, at least until the webkit hackers add a global setting. > > Furthermore we need to modify the Sugar version in Browse accordingly > with each Sugar release as the Sugar version is only availble in the > shell and not in the toolkit. I hope the tookit changes accordingly so we don't have to hardcore that in activities. Acked-by: Manuel Quiñones > > [1] https://lists.webkit.org/pipermail/webkit-gtk/2012-January/000893.html > > Signed-off-by: Simon Schampijer > --- > browser.py | 7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/browser.py b/browser.py > index 83cc7ea..c5165db 100644 > --- a/browser.py > +++ b/browser.py > @@ -383,9 +383,16 @@ class Browser(WebKit.WebView): > ([str])), > } > > + CURRENT_SUGAR_VERSION = '0.96' > + > def __init__(self): > WebKit.WebView.__init__(self) > > + web_settings = self.get_settings() > + identifier = ' Sugar Labs/' + self.CURRENT_SUGAR_VERSION > + web_settings.props.user_agent += identifier > + self.set_settings(web_settings) > + > # Reference to the global history and callbacks to handle it: > self._global_history = globalhistory.get_global_history() > self.connect('notify::load-status', self.__load_status_changed_cb) > -- > 1.7.7.5 > > ___ > Sugar-devel mailing list > Sugar-devel@lists.sugarlabs.org > http://lists.sugarlabs.org/listinfo/sugar-devel -- .. manuq .. ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
Why not add the the sugar version in the toolkit? Probably would be useful for other activities too, and is a good time to add it. May be you can add it to the gtk3 toolkit then the ported activities can use it. Gonzalo On Mon, Jan 16, 2012 at 8:52 AM, Simon Schampijer wrote: > This identifier is used in ASLO to determine which activities > can be downloaded (ASLO is parsing the user agent of the Browser > to provide an appropriate activity version, if it fails to get > the Sugar version from the agent string, it uses the last stable version, > which is 0.94 at the moment). > > One thing that is not perfectly handled by this patch is that we > need to modify the user agent for every WebView (see [1]). > > Furthermore we need to modify the Sugar version in Browse accordingly > with each Sugar release as the Sugar version is only availble in the > shell and not in the toolkit. > > [1] https://lists.webkit.org/pipermail/webkit-gtk/2012-January/000893.html > > Signed-off-by: Simon Schampijer > --- > browser.py |7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/browser.py b/browser.py > index 83cc7ea..c5165db 100644 > --- a/browser.py > +++ b/browser.py > @@ -383,9 +383,16 @@ class Browser(WebKit.WebView): > ([str])), > } > > +CURRENT_SUGAR_VERSION = '0.96' > + > def __init__(self): > WebKit.WebView.__init__(self) > > +web_settings = self.get_settings() > +identifier = ' Sugar Labs/' + self.CURRENT_SUGAR_VERSION > +web_settings.props.user_agent += identifier > +self.set_settings(web_settings) > + > # Reference to the global history and callbacks to handle it: > self._global_history = globalhistory.get_global_history() > self.connect('notify::load-status', self.__load_status_changed_cb) > -- > 1.7.7.5 > > ___ > 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
[Sugar-devel] [PATCH browse] Append the current Sugar (Sucrose) version to the user agent
This identifier is used in ASLO to determine which activities can be downloaded (ASLO is parsing the user agent of the Browser to provide an appropriate activity version, if it fails to get the Sugar version from the agent string, it uses the last stable version, which is 0.94 at the moment). One thing that is not perfectly handled by this patch is that we need to modify the user agent for every WebView (see [1]). Furthermore we need to modify the Sugar version in Browse accordingly with each Sugar release as the Sugar version is only availble in the shell and not in the toolkit. [1] https://lists.webkit.org/pipermail/webkit-gtk/2012-January/000893.html Signed-off-by: Simon Schampijer --- browser.py |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/browser.py b/browser.py index 83cc7ea..c5165db 100644 --- a/browser.py +++ b/browser.py @@ -383,9 +383,16 @@ class Browser(WebKit.WebView): ([str])), } +CURRENT_SUGAR_VERSION = '0.96' + def __init__(self): WebKit.WebView.__init__(self) +web_settings = self.get_settings() +identifier = ' Sugar Labs/' + self.CURRENT_SUGAR_VERSION +web_settings.props.user_agent += identifier +self.set_settings(web_settings) + # Reference to the global history and callbacks to handle it: self._global_history = globalhistory.get_global_history() self.connect('notify::load-status', self.__load_status_changed_cb) -- 1.7.7.5 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel