The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

keyboard shortcut to domain.com

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

18. October 2011, 20:03:53

epilos

Posts: 2044

keyboard shortcut to domain.com

hello

can I create a shortkey to go to www.domain.com of the current tab? (the tab may be at something.domain.com/something, etc)

thanks
Opera 11 on WinXP Pro SP3 • AMD hexacore 3.2Ghz with 4Gb RAM

19. October 2011, 17:17:25

epilos

Posts: 2044

any hint?
Opera 11 on WinXP Pro SP3 • AMD hexacore 3.2Ghz with 4Gb RAM

19. October 2011, 17:48:31

Moderator

Tamil

:-(|)

Posts: 115322

Use the following action code.
javascript:var p=document.domain.split('.');window.location.href='http://www.'+p[1]+'.'+p[2];

22. October 2011, 17:08:04

epilos

Posts: 2044

it works flawlessly! thanks!
how do I assign this to a keyboard key? Go to "javascript:var p=document.domain.split('.');window.location.href='http://www.%27+p[1]+%27.%27+p[2];" ?
Opera 11 on WinXP Pro SP3 • AMD hexacore 3.2Ghz with 4Gb RAM

22. October 2011, 17:44:24

mikeray

Posts: 253

@epilos: Preferences (Ctrl + F12) -> Advanced -> Shortcuts -> Keyboard Setup -> Edit -> Select 'Document Window' -> Click on New -> Type your preferred key combination in the left column and in the right column, paste @Tamil's code as:
Go to page, "javascript:var p=document.domain.split('.');window.location.href='http://www.'+p[1]+'.'+p[2];"

I would like to add that going to the root domain will require more complicated code as some domains can be aa.bb.cc.domain.co.uk, but the above code will work on many popular websites.

28. October 2011, 10:49:52

epilos

Posts: 2044

I try to assing it to "Backspace ctrl alt" and it does not work :S
Opera 11 on WinXP Pro SP3 • AMD hexacore 3.2Ghz with 4Gb RAM

Forums » Opera for Windows/Mac/Linux » Opera browser