Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » # in twitter URL causes browser not to load(# (pound sign) causes twitter status links to not load in browser class on linux)
# in twitter URL causes browser not to load [message #742427] Thu, 20 October 2011 09:33 Go to next message
Carolyn  is currently offline Carolyn
Messages: 6
Registered: October 2011
Junior Member
Hello,

I am using the SWT with DJSweet to generate screen captures of a web browser from my java program.

All is working well on Windows, but on Linux there is an issue with accessing twitter statuses.

I believe the problem is the # (pound/ hash) sign in the twitter status URL, which java interprets as a fragment identifier.

An example status is:
twitter.com/#!/mexicanjoe/statuses/122004755785588736


On windows the complete URL seems to load, but on Linux on the part prior to the # sign loads.

I have tried escaping the # sign, but that does not get unescaped and gets a 404 error.

Any ideas would be appritiated!

Thanks!

-- Carolyn
Re: # in twitter URL causes browser not to load [message #743345 is a reply to message #742427] Fri, 21 October 2011 07:22 Go to previous messageGo to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
try to upgrade your native browser? and then check...

---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: # in twitter URL causes browser not to load [message #743405 is a reply to message #743345] Fri, 21 October 2011 08:49 Go to previous messageGo to next message
Carolyn  is currently offline Carolyn
Messages: 6
Registered: October 2011
Junior Member
Hello,

I checked and accoring to yum I have the most upto date version of xulrunner.

xulrunner-1.9.2.9-1.el6.centos.x86_64

What version would you reccomend?

-- Carolyn
Re: # in twitter URL causes browser not to load [message #743764 is a reply to message #743405] Fri, 21 October 2011 14:14 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Hi,

I've confirmed that it is a problem in the XULRunner version you're
using, because stand-alone Firefox 3.6.x shows the same behaviour.
Unfortunately the Browser currently only supports XULRunner versions up
to 3.6.x, which corresponds to Firefox 3.6.x, so I don't think there's a
Browser-supported XULRunner version where this works. There is an
eclipse 3.8 plan item to support newer XULRunner versions, so this would
likely make your case start to work.

One other possibility: URLs like this work fine in WebKitGTK. You
should be able to make use of this instead of XULRunner if all of the
following are true:

- DJSweet is creating its Browser with style SWT.NONE, not SWT.MOZILLA
- your Linux distro provides libraries for WebKitGTK >= 1.2.x (this has
been the case for 2-3 years)
- the underlying SWT version is 3.7.x, or alternatively it can be 3.6.2
iff the conditions in
http://www.eclipse.org/swt/faq.php#browserwebkitgtk are met

HTH,
Grant


On 10/21/2011 8:49 AM, Carolyn wrote:
> Hello,
>
> I checked and accoring to yum I have the most upto date version of
> xulrunner.
>
> xulrunner-1.9.2.9-1.el6.centos.x86_64
>
> What version would you reccomend?
>
> -- Carolyn
Re: # in twitter URL causes browser not to load [message #745411 is a reply to message #743764] Sat, 22 October 2011 16:16 Go to previous messageGo to next message
Carolyn  is currently offline Carolyn
Messages: 6
Registered: October 2011
Junior Member
Hi Grant,
I installed webkitgtk.x86_64 version 1.2.6-2.el6_0 via yum.

Unfortunately I am getting the same results.

I am using the latest version of the SWT toolikit. Do I need to set any flags to get it to use the GTK?

In addition I removed XULRunner from the paths.

Thanks for your help!

-- Carolyn
Re: # in twitter URL causes browser not to load [message #748156 is a reply to message #745411] Mon, 24 October 2011 10:19 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
SWT 3.7.x should not have any problem with using this WebKitGTK version.

- is DJSweet definitely using this swt install (it's not actually
pointed at another swt version installed elsewhere)?
- your swt version is 64-bit (since your webkitgtk libraries apparently
are)?
- is it possible that DJSweet is creating its Browser instance with
style SWT.MOZILLA (in which case it would not consider using WebKitGTK)?

Grant


On 10/22/2011 4:16 PM, Carolyn wrote:
> Hi Grant,
> I installed webkitgtk.x86_64 version 1.2.6-2.el6_0 via yum.
>
> Unfortunately I am getting the same results.
>
> I am using the latest version of the SWT toolikit. Do I need to set any
> flags to get it to use the GTK?
>
> In addition I removed XULRunner from the paths.
>
> Thanks for your help!
>
> -- Carolyn
Re: # in twitter URL causes browser not to load [message #752801 is a reply to message #748156] Wed, 26 October 2011 10:22 Go to previous messageGo to next message
Carolyn  is currently offline Carolyn
Messages: 6
Registered: October 2011
Junior Member
Hello,

I created a simple test to make sure that DJSweet was not adding anything. I am still not having any luck.

The code is below. I am using swt-3.7-gtk-linux-x86_64.

I have both Xulrunner and the webkitgtk installed ont he machine. Do I need to remove Xulrunner from the system?

package com.pangea.thumbnail;

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.*;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

public class TestSWTBrowser {
    public static void main(String [] args){
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());

        shell.layout(true,true);
        shell.setSize(800, 1024);
        Browser browser = null;
        try {
           browser = new Browser(shell, SWT.NONE);
           // space added since I am not allowed to posta URL
           browser.setUrl("h t t p : / /twitter.com/#!/mexicanjoe/statuses/122004755785588736");
        } catch (SWTError e) {
           MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
           messageBox.setMessage("Browser cannot be initialized.");
           messageBox.setText("Exit");
           messageBox.open();
           System.exit(-1);
        }
        shell.open();        
        shell.setVisible(true);
        boolean interupted = false;
        boolean working = true;
        while (!interupted && (!display.isDisposed())){
            if (!(working = display.readAndDispatch())) {
                display.sleep();
            }
            //System.out.println("Display status: "+working);
        }
        display.dispose();

    }

}

Re: # in twitter URL causes browser not to load [message #753500 is a reply to message #752801] Thu, 27 October 2011 09:45 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
You don't need to remove XULRunner for eclipse/swt 3.7 to use WebKitGTK.

Can you add the following line to the beginning of your snippet and see
what's written to stdout?

Device.DEBUG = true;

Grant


On 10/26/2011 10:22 AM, Carolyn wrote:
> Hello,
>
> I created a simple test to make sure that DJSweet was not adding
> anything. I am still not having any luck.
>
> The code is below. I am using swt-3.7-gtk-linux-x86_64.
>
> I have both Xulrunner and the webkitgtk installed ont he machine. Do I
> need to remove Xulrunner from the system?
>
> package com.pangea.thumbnail;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.SWTError;
> import org.eclipse.swt.browser.*;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.MessageBox;
> import org.eclipse.swt.widgets.Shell;
>
> public class TestSWTBrowser {
> public static void main(String [] args){
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setLayout(new FillLayout());
>
> shell.layout(true,true);
> shell.setSize(800, 1024);
> Browser browser = null;
> try {
> browser = new Browser(shell, SWT.NONE);
> // space added since I am not allowed to posta URL
> browser.setUrl("h t t p : /
> /twitter.com/#!/mexicanjoe/statuses/122004755785588736");
> } catch (SWTError e) {
> MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
> messageBox.setMessage("Browser cannot be initialized.");
> messageBox.setText("Exit");
> messageBox.open();
> System.exit(-1);
> }
> shell.open(); shell.setVisible(true);
> boolean interupted = false;
> boolean working = true;
> while (!interupted && (!display.isDisposed())){
> if (!(working = display.readAndDispatch())) {
> display.sleep();
> }
> //System.out.println("Display status: "+working);
> }
> display.dispose();
>
> }
>
> }
>
>
Re: # in twitter URL causes browser not to load [message #754072 is a reply to message #753500] Mon, 31 October 2011 12:20 Go to previous messageGo to next message
Carolyn  is currently offline Carolyn
Messages: 6
Registered: October 2011
Junior Member
Hi Grant,

Here is the output:

[ec2-user@ip-10-194-7-152 ~]$ Xlib:  extension "RANDR" missing on display "localhost:2.0".
WebKit version 1.2.6



Thanks for your help!

-- Carolyn
Re: # in twitter URL causes browser not to load [message #754226 is a reply to message #754072] Tue, 01 November 2011 09:53 Go to previous messageGo to next message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Ok, I see. RHEL6 has WebKitGTK 1.2.6, and I see your problem happen
there. However Ubuntu 10.04 has WebKitGTK 1.2.7 and the page shows
fine. So it looks like this behaviour was fixed in WebKitGTK 1.2.7.
Upgrading your OS's WebKitGTK to a newer version should fix this for you.

Grant


On 10/31/2011 12:20 PM, Carolyn wrote:
> Hi Grant,
>
> Here is the output:
>
>
> [ec2-user@ip-10-194-7-152 ~]$ Xlib: extension "RANDR" missing on display
> "localhost:2.0".
> WebKit version 1.2.6
>
>
>
> Thanks for your help!
>
> -- Carolyn
>
Re: # in twitter URL causes browser not to load [message #757102 is a reply to message #754226] Wed, 16 November 2011 09:04 Go to previous messageGo to next message
Carolyn  is currently offline Carolyn
Messages: 6
Registered: October 2011
Junior Member
Hi Grant,

I have been trying to no avail to upgrade my version of WebKitGTK on Centos to 1.2.7.

I grabbed a Ferdora RPM and tried to recompile it, but that gave me errors on GLIB.

I then grabbed the GLIB upgrade and tried to compile that, but I get an odd error message.

Do you have any idea where RPMs for Ubuntu would be? All I found were deb files.

I am really not greate when it comes to Linux, so if I am asking an obvious question please excuse me.

-- Carolyn
Here is the command I ran to rebuild the rpm
 rpmbuild --rebuild glib2-2.24.1-1.fc13.src.rpm > rebuild3.out 2>&1 & 

Here is the error incase that might spark some ideas...
libtool: link: (cd ".libs" && rm -f "libgthread-2.0.so.0" && ln -s "libgthread-2.0.so.0.2400.1" "libgthread-2.0.so.0")
libtool: link: (cd ".libs" && rm -f "libgthread-2.0.so" && ln -s "libgthread-2.0.so.0.2400.1" "libgthread-2.0.so")
libtool: link: ar cru .libs/libgthread-2.0.a  gthread-impl.o
libtool: link: ranlib .libs/libgthread-2.0.a
libtool: link: ( cd ".libs" && rm -f "libgthread-2.0.la" && ln -s "../libgthread-2.0.la" "libgthread-2.0.la" )
make[3]: Leaving directory `/home/ec2-user/rpmbuild/BUILD/glib-2.24.1/gthread'
Making all in tests
make[3]: Entering directory `/home/ec2-user/rpmbuild/BUILD/glib-2.24.1/gthread/tests'
gcc -DHAVE_CONFIG_H -I. -I../.. -g -I../.. -I../../glib -DG_DISABLE_CAST_CHECKS  -DG_DISABLE_SINGLE_INCLUDES -pthread  -O2 -g -Wall -MT 1bit-mutex.o -MD -MP -MF .deps/1bit-mutex.Tpo -c -o 1bit-mutex.o 1bit-mutex.c
make[2]: *** wait: No child processes.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** wait: No child processes.  Stop.
make[1]: *** wait: No child processes.  Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: *** wait: No child processes.  Stop.
make: *** wait: No child processes.  Stop.
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.zoYY2b (%build)


RPM build errors:
   InstallSourcePackage at: psm.c:244: Header V3 RSA/SHA256 Signature, key ID e8e40fde: NOKEY
   user mockbuild does not exist - using root
   group mockbuild does not exist - using root
   user mockbuild does not exist - using root
   group mockbuild does not exist - using root
   user mockbuild does not exist - using root
   group mockbuild does not exist - using root
   user mockbuild does not exist - using root
   group mockbuild does not exist - using root
   Bad exit status from /var/tmp/rpm-tmp.zoYY2b (%build)
make[3]: *** [1bit-mutex.o] Hangup
Re: # in twitter URL causes browser not to load [message #757929 is a reply to message #757102] Wed, 16 November 2011 16:39 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
I'm not great with managing RPMs like this either, and try to avoid
mixing them between distros.

Since you already have WebKitGTK 1.2.6, you presumably have all of the
dependencies that any WebKitGTK 1.2.x release would need. My experience
was that compiling WebKitGTK from source was reasonably straightforward
once all of the required dev packages are installed. You may wish to
try this if the whole RPM thing is giving you a headache.
http://trac.webkit.org/wiki/BuildingGtk is probably an accurate list of
the required dev packages, just ignore the stated version requirements
since they're for building WebKitGTK 1.6.x. If you get it built then
you can point to it at runtime by setting the LD_LIBRARY_PATH
environment variable.

Or alternatively, maybe you can install a newer linux distro?

Grant


On 11/16/2011 9:04 AM, Carolyn wrote:
> Hi Grant,
>
> I have been trying to no avail to upgrade my version of WebKitGTK on
> Centos to 1.2.7.
>
> I grabbed a Ferdora RPM and tried to recompile it, but that gave me
> errors on GLIB.
>
> I then grabbed the GLIB upgrade and tried to compile that, but I get an
> odd error message.
>
> Do you have any idea where RPMs for Ubuntu would be? All I found were
> deb files.
>
> I am really not greate when it comes to Linux, so if I am asking an
> obvious question please excuse me.
>
> -- Carolyn
> Here is the command I ran to rebuild the rpm rpmbuild --rebuild
> glib2-2.24.1-1.fc13.src.rpm > rebuild3.out 2>&1 & Here is the error
> incase that might spark some ideas...
>
> libtool: link: (cd ".libs" && rm -f "libgthread-2.0.so.0" && ln -s
> "libgthread-2.0.so.0.2400.1" "libgthread-2.0.so.0")
> libtool: link: (cd ".libs" && rm -f "libgthread-2.0.so" && ln -s
> "libgthread-2.0.so.0.2400.1" "libgthread-2.0.so")
> libtool: link: ar cru .libs/libgthread-2.0.a gthread-impl.o
> libtool: link: ranlib .libs/libgthread-2.0.a
> libtool: link: ( cd ".libs" && rm -f "libgthread-2.0.la" && ln -s
> "../libgthread-2.0.la" "libgthread-2.0.la" )
> make[3]: Leaving directory
> `/home/ec2-user/rpmbuild/BUILD/glib-2.24.1/gthread'
> Making all in tests
> make[3]: Entering directory
> `/home/ec2-user/rpmbuild/BUILD/glib-2.24.1/gthread/tests'
> gcc -DHAVE_CONFIG_H -I. -I../.. -g -I../.. -I../../glib
> -DG_DISABLE_CAST_CHECKS -DG_DISABLE_SINGLE_INCLUDES -pthread -O2 -g
> -Wall -MT 1bit-mutex.o -MD -MP -MF .deps/1bit-mutex.Tpo -c -o
> 1bit-mutex.o 1bit-mutex.c
> make[2]: *** wait: No child processes. Stop.
> make[2]: *** Waiting for unfinished jobs....
> make[2]: *** wait: No child processes. Stop.
> make[1]: *** wait: No child processes. Stop.
> make[1]: *** Waiting for unfinished jobs....
> make[1]: *** wait: No child processes. Stop.
> make: *** wait: No child processes. Stop.
> make: *** Waiting for unfinished jobs....
> make: *** wait: No child processes. Stop.
> error: Bad exit status from /var/tmp/rpm-tmp.zoYY2b (%build)
>
>
> RPM build errors:
> InstallSourcePackage at: psm.c:244: Header V3 RSA/SHA256 Signature, key
> ID e8e40fde: NOKEY
> user mockbuild does not exist - using root
> group mockbuild does not exist - using root
> user mockbuild does not exist - using root
> group mockbuild does not exist - using root
> user mockbuild does not exist - using root
> group mockbuild does not exist - using root
> user mockbuild does not exist - using root
> group mockbuild does not exist - using root
> Bad exit status from /var/tmp/rpm-tmp.zoYY2b (%build)
> make[3]: *** [1bit-mutex.o] Hangup
>
Previous Topic:Named separator menu items
Next Topic:Memory leak with SWT browser
Goto Forum:
  


Current Time: Thu Aug 21 18:18:31 EDT 2014

Powered by FUDForum. Page generated in 0.02188 seconds