Right click link capture

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I want to add an item to my IE context menu that when right clicking a link on a page like http://script.download.com/example.js it gives me the option to view source instead of downloading it then having to open it with notepad or what not.

So far I have my registry entry setup with the menu item to popup only when links are right-clicked like so, (Contexts is set to 10 when using highlight method)
Code: [ Select ]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Preview Source]
@="C:\\preview_source.js"
"Contexts"=hex:20
  1. [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Preview Source]
  2. @="C:\\preview_source.js"
  3. "Contexts"=hex:20


The problem I have is how to pass the link to my script without having to highlight the link :?

Preferably Javascript.

Works fine passing highlighted links to my script that appends it to the VIEW-SOURCE: protocall but I want to be able to just right-click and go 8)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

when you right click on a link focus gets put on it.... Is there anyway of using js to detect which object has focus?

My big book of ultimate Javascript knowledge is at home and I'm not, but thats the directionI would start going in.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

It won't be able to view the source until it has downloaded it. So you would still have to download it somehow beforehand.

I just right click, save target as, put it in temp, then fire it up in a text editor.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Axe wrote:
It won't be able to view the source until it has downloaded it. So you would still have to download it somehow beforehand.


I got the impression that joebert had already got it working if he highlighted the link - he's just too lazy to highlight :wink:
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Damnit! I hate when Axe is right :lol:
I've been testing this with links to various pages not js files :oops:

I just realized (after Axes smack upside my head :lol: )
that view-source: won't work with JS files. :cry:

Oh well back to doing it the old way i guess :?

maybe i can still scrap this to be a read a page before you visit it gimick :lol:

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 90 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.