LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2016, 03:03 PM   #1
Utarg
LQ Newbie
 
Registered: Jul 2016
Posts: 6

Rep: Reputation: Disabled
Opening a browser midpage from command line


Hi,

I'm writing a script the features the below line:

/usr/bin/firefox https://www.youtube.com/ &

I need the page to open in the middle of its content instead of the top, as it does by default. Is it possible to do that?
 
Old 11-08-2016, 06:04 PM   #2
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Maybe if the page has something like this: http://stackoverflow.com/questions/1...n-scroll-point

E.g: https://en.wikipedia.org/wiki/Greasemonkey
or https://en.wikipedia.org/wiki/Greasemonkey#See_also

good luck?
 
Old 11-08-2016, 07:39 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
So far as I am aware, the only reasonably-reliable way to do that is with <a> anchor-tags within the HTML content that is being displayed, as noted in the referenced StackOverflow reply.
 
1 members found this post helpful.
Old 11-08-2016, 08:24 PM   #4
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Utarg, my second link is to a plug in that can:
Quote:
... install scripts that make on-the-fly changes to web page content after or before the page is loaded in the browser (also known as augmented browsing). ...
 
Old 11-08-2016, 09:52 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
"... but will they work on Internet Explorer 8?"

... ...
 
Old 11-09-2016, 01:43 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by Utarg View Post
I need the page to open in the middle of its content instead of the top, as it does by default. Is it possible to do that?
Anchor elements have been shown but should be mentioned by name, no pun intended. What you are looking for in the target page is an anchor element with a name="" attribute somewhere, if the target is not HTML5. If the target is HTML5, then an id attribute is needed. An id attribute can be used in earlier versions of HTML / XHTML.

IMHO HTML5 is a mess from having had influence from M$, which only ever leads to damage.

Be that as it may, the page you use as an example, youtube.com, is HTML5 and has a lot of elements with id attributes to choose from. But most of them seem to be auto-generated and random and thus unpredictable. There are a few apparently fixed ones like "guide" scattered about:

http://www.youtube.com/#guide
 
Old 11-09-2016, 06:05 AM   #7
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Question

Quote:
Originally Posted by sundialsvcs View Post
"... but will they work on Internet Explorer 8?"

... ...
I'm sure you can augment any pages you are viewing... but the script is for:
/usr/bin/firefox and?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
opening an html file from command line ashlesha Linux - Newbie 6 10-01-2017 06:05 PM
opening eog as slideshow from command line? thefountainhead100 Linux - Software 1 03-08-2008 05:24 PM
Opening a directory in command line Yash Pal Linux - Newbie 8 07-27-2007 03:45 AM
Opening multiple instances of Seamonkey from the command line? vonst Linux - Software 3 01-20-2007 03:33 PM
Opening an X program from ssh command line petway56 Linux - General 2 02-14-2003 04:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration