I have a function in a bash script (openWebPage) which I want to open a web page and navigate to an id tag within the page.
The url components are held in variables
PIXPAGE="/home/bu5hman/pix/pixpages/media.bu5hman.2005-.video.htm" TT="tt0078435" The call to the function composes the variables
openWebPage "$PIXPAGE#$TT" Within the function, if I hard code the call to my default browser (seamonkey) directly with a file url which has a tag specified
/home/bu5hman/Installs/seamonkey/seamonkey "file://$1" the page opens at the required tag, however using
xdg-open "file://$1" opens the web page at the top but does not navigate to the tag within the page.
When the browser is called directly it opens with the full url and tag in the navigation bar, but when called using xgd-open it opens with the url stripped of the tag (#tt0078435) in the navigation bar.
It appears that xdg-open strips the tag from the url before passing it to the application.
Aside from using a script to interrogate the system for the default browser and composing a direct call, is there a way to either prevent xdg-open from stripping the tag or an alternative cross platform call to open the web page at the tag?
xdg-open "http://example.com/#123"works exactly as expected.