Sign up | Lost password? | Help

[ advanced search ]

[UserJS] retreive link information (size, date, etc)

Forums » Opera Community » General Opera topics » User JavaScript

Go to last post

Friday, 17. March 2006, 05:04:18

xErath

javascript guru

avatar

Posts: 6404

Norway

Opera Software

[UserJS] retreive link information (size, date, etc)

Hi there again. I've made a new excellent script. It enables the user not to be bugged whenever he/she wants to know the size of a file to be downloaded, by clicking the link rather that getting it's size, reported by the server. It too shows the date sent, mime-type of file, and server software too. It supports cross-server links.
Technically it uses a HEAD http request to get the info, and uses a iframe to bypass cross-domain scripting restrictions.

How to use:
  • First location your Opera's menu configuration
  • Browse to your profile directory: see Help->About Opera
  • find the file standard_menu.ini or menu.ini in directory /menu
  • if the later doesn't exit browse to your Opera's installation directory and use defaults/standard_menu.ini
  • important: close Opera
  • open the file with a text editor and search for section [Link Popup Menu]
  • add the lines in bold to that section
    [Link Popup Menu]
    Item, 67389= Open link
    Item, 53018= Open link in new page
    Item, 53019= Open link in background page
    --------------------1
    Item, 54020= Open link in new window
    Item, 67633= Open link in background window
    --------------------2
    Item, 70463= Add link to bookmarks
    Item, 50216= Copy link
    Item, 50761= Save link
    Item, 67350= Download url
    [b]--------------------3[/b]
    [b]Item, "Link Information" = Go to page, "javascript:window.ujs_get_link_info('%l');"[/b]
  • save the file and close it, open Opera.
  • you must have javascript enabled: right-click any link and from the popup menu select the Link Information entry
  • A small popup window will appear with the information

Note: links information can only be retrieved for http links (excluding https too). Due to a magnificent Opera bug, if you view a link information and go back in history, Opera will crash. It's not my fault :smile: (edit: see below)
get-link-info.js

EDIT: I found the crasher problem. aborting the request caused Opera to store something that triggered the crash.
The script above is fixed. The crashing version is this one.
get-link-info-crasher.js

Friday, 17. March 2006, 05:36:47

zyph

avatar

Posts: 212

Norway

Lovely script!

Although the go back bug sure is annoying.

Friday, 17. March 2006, 06:12:57 (edited)

xErath

javascript guru

avatar

Posts: 6404

Norway

Opera Software
bug reported 200753
use with caution
edit: crasher found, see above

Sunday, 26. March 2006, 12:43:12

Is there any way to download the largest image contained on the linked page? I am looking for a way to grab the largest images on separately linked pages and show them on a single page.

There is a bookmarklet (Show All Images) which does this if the images are directly linked, but not if the link is to a page containing the image.

Sunday, 26. March 2006, 23:05:01

xErath

javascript guru

avatar

Posts: 6404

Norway

Opera Software

Originally posted by cbjohnso:

Is there any way to download the largest image contained on the linked page?

well that's off-topic. But yes there's a way, not using this script though, but using another solution.

Tuesday, 2. October 2007, 12:56:38

AyushJ

avatar

Posts: 4754

This script is not working in Kestrel because of your name xErath p:
See #3 - http://my.opera.com/community/forums/findpost.pl?id=2235408

Friday, 31. October 2008, 23:45:31

cscat

avatar

Posts: 54

Canada

yes. it doesn't work in opera 9.52!!!

Forums » Opera Community » General Opera topics » User JavaScript