bugGnash - The GNU Flash player - Bugs: bug #21155, links are opened using hard-coded...

 
 

bug #21155: links are opened using hard-coded browser

Submitter:  Chris Robinson <kcat>
Submitted:  Tue 25 Sep 2007 05:16:13 AM UTC
   
 
Category:  core Severity:  3 - Normal
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  strk
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 26 Dec 2007 09:32:27 PM UTC, comment #15: 

Oh, to make testing easier, this is what you need in your ~/.gnashrc:

 set urlOpenerFormat xdg-open %u

or

 set urlOpenerFormat firefox -remote 'openurl(%u)'

or whatever... %u will be substituted with the actual url.

Sandro Santilli <strk>
Group Member
Wed 26 Dec 2007 06:04:23 PM UTC, comment #14: 

I've added a gnashrc-driven version for now.
Will not fix the "opens in new tab" or "opens in new window" problem, nor it will support named targets for opening the url...
Anyway fixes the bug as expressed in the summary.

Sandro Santilli <strk>
Group Member
Fri 28 Sep 2007 03:03:35 PM UTC, comment #13: 

I agree about avoiding javascript.
I guess all this discussion would have been betted done in the task  item... anyway let's not get lost in details. Are you going to implement something crhis ? :)

Sandro Santilli <strk>
Group Member
Fri 28 Sep 2007 02:29:22 PM UTC, comment #12: 

I think if it can be done without javascript, it should. Flash itself doesn't require javascript, and some people may prefer to leave it off. Unless that's the way it's actually done, in which case there's not much choice.

The nsplugin api uses a method for streaming data between processes (from the plugin to gnash's stdin). If a similar stream can be done from gnash's stdout that the plugin listens for (leaving stderr for the normal/verbose output), that could get commands through too. KDE's KProcess has methods for listening to its process's stdout, while the nsplugin should be fine with pipe, dup2, select, and read.

Chris Robinson <kcat>
Fri 28 Sep 2007 02:15:33 PM UTC, comment #11: 

I'm actually in the process of slowly adding Dbus support to Gnash, so this could be an actual possibility. The way this should really work would be to create a pipe between the plugin and Gnash, to allows Gnash to send JavaScript back to the browser.

Rob Savoye <rsavoye>
Group administrator
Fri 28 Sep 2007 02:07:55 PM UTC, comment #10: 

We could try DBus. KDE3 uses DCOP, but KDE4 and and most others are moving/have moved to DBus, so it's likely to be available I think, even on KDE3 systems. Have the nsplugin/kbrowserextension register a dbus destination, add an option to gnash to pass the id through, and use dbus to tell the plugin to open the url in a given target. When the plugin closes, remove the destination.

I can't say I know how to use DBus, though.

Chris Robinson <kcat>
Fri 28 Sep 2007 11:25:51 AM UTC, comment #9: 

Note that the -remote thing is bogus on all machines I have. No way to specify a target. Updated summary so it's not kde specific.

About the plugin callback: the plugin forks and execs so we still need some IPC here (thus a protocol)

Sandro Santilli <strk>
Group Member
Fri 28 Sep 2007 10:00:19 AM UTC, comment #8: 

As for task #5919, I think the best solution would be to call back into the controlling plugin (either the nsplugin or kpart) and have it call the appropriate browser to open the url with the given target. KDE should have an API for dealing with it itself, and I think the nsplugin API has methods to handle it (adobe's flash plugin uses the nsapi and Just Works on various browsers without setup, afaik).

In the case of no controlling plugin (ie. run from the stand-alone player), we may just need to call xdg-open with the URL.

Chris Robinson <kcat>
Fri 28 Sep 2007 09:46:55 AM UTC, comment #7: 

I'd wager it uses the -remote syntax so it can optionally specify a target, although that bit of code is disabled right now. All browsers should be able to open a URL by simply running the executable with the URL right after it, but you can't name a target that way.

Chris Robinson <kcat>
Fri 28 Sep 2007 09:38:39 AM UTC, comment #6: 

following up here from 21175 though this is kde related while my problem is more general:

gnash insists on calling firefox all the time along with the ugly -remote openurl syntax...

With the browser I'm using:
kazehakase I don't need to pass any -remote or such... It'll simply open it when called directly via:
kazehakase $URL

The browser is gecko based so I don't see why gnash couldn't be calling something internal or some such...

Andraž ruskie Levstik <ruskie>
Wed 26 Sep 2007 07:24:10 PM UTC, comment #5: 

The proper solution is likely the one described in
task #5919, please take a look.

Sandro Santilli <strk>
Group Member
Wed 26 Sep 2007 06:36:40 PM UTC, comment #4: 

As I'm understanding it, flash files can open a url in a specific window (the current one, a new one, a named one it opened previously), which will almost certainly need system/browser specific methods.

xdg-open should be fine for a quick solution, however I think you need to take care for if it tries to open a link in the existing window. If a flash happens to run in a loop trying to open a url in the current window, it'd end up spawning window after window. In such a case, I think Gnash would need to abort (which, if it had loaded a url in the current window, it'd end the process anyway).

Chris Robinson <kcat>
Wed 26 Sep 2007 06:23:15 PM UTC, comment #3: 

I guess we might use xdg-open if available as a quick hack (detected at ./configure time).

In the long term we should have an handle to the GUI anyway, for things like prompting user (like, for allowing or denying a network access, or for telling us wheter to continue running a script even if it's taking too much time).

Sandro Santilli <strk>
Group Member
Tue 25 Sep 2007 08:03:25 AM UTC, comment #2: 

The default browser can be set via going to K->Control Center->KDE Components->Component Chooser, then highlighting Web Browser. For a KDE app, as kde-gnash is/should be, this setting should be considered the system/user default browser.

For other protocols, I don't know. I'd imagine sending it to the system-defined handler for that type, too. In KDE's Control Center you can see what they are under KDE Components->File Associations and expanding 'uri'.

Under KDE, the command to run is:
kfmclient exec <URL>
which will open a given URL/file using the correct handler set in the Control Center. Windows can do similar with it's start command.

Going the Freedesktop.org psudeo-standard route, the command:
xdg-open <URL>
appears to do the same thing, and appears to honor my KDE settings (in fact, it seems to call kmfclient on my system). Though the man page says it only supports "file, ftp, http and https URLs". So others like rtsp and mms may not work on all systems, even if there's a registered handler.

Chris Robinson <kcat>
Tue 25 Sep 2007 07:31:58 AM UTC, comment #1: 

From the standalone player, gnash ought to use the system / user default browser to open hyperlinks (whether it's kde-gnash or gtk-gnash shouldn't matter, since kde-gnash can be run from any desktop environment with correspondingly different default browsers).

Environment variables would be one option: I have environment variable BROWSER set to a script /usr/bin/www-browser. However, that's not safe for every OS.

We could perhaps look for an environment variable, but revert to a different browser if none is present.

Where is KDE's default web browser setting?

[ What about protocols other than hypertext? If a movie has an mms:// link, should that be sent to a browser, only for it to launch a media player, or directly to the media player? ]

Benjamin Wolsey <bwy>
Group Member
Tue 25 Sep 2007 05:16:13 AM UTC, original submission:  

Gnash appears to always try to open links using Firefox. While that may be a safe assumption for GTK apps, it really isn't for KDE.

KDE has a setting for a default web browser (which may or may not be set to konqueror), and it would be nice if kde-gnash could call that, instead of assuming firefox.. which incidentally isn't installed on my system, but I can only imagine the annoyance if a flash embedded in a web page using konqueror opens firefox for its links, and vice versa.

From what I can tell, this is the kind of thing that would be a GUI player handler (eg. Player::openUrl), so gtk-gnash would use whatever GTK uses, and kde-gnash would use the KDE player to call what KDE has set. It seems, however, that the browser is called from SWFHandlers::CommonGetUrl in server/vm/ASHandlers.cpp, where there's no direct access to a GUI player object.

Chris Robinson <kcat>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   task dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rsavoye (Posted a comment)
  • -email is unavailable- added by ruskie (Posted a comment)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by bwy (Posted a comment)
  • -email is unavailable- added by kcat (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-01-23 strk StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2008-01-14 strk Dependencies- Depends on task #5919
    2007-12-26 strk StatusConfirmed Ready For Test
        Assigned toNone strk
    2007-09-28 strk Categorygui-kde3 core
        StatusNone Confirmed
        Summarykde-gnash doesn\'t open links with KDE\'s set browser links are opened using hard-coded browser

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code