Home  >  Article  >  Web Front-end  >  A few simple lines of JS Code to implement IE mail forwarding to Sina Weibo_javascript skills

A few simple lines of JS Code to implement IE mail forwarding to Sina Weibo_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:30:151389browse

Recently I just opened Sina Bib, and I suddenly had the idea to make a browser plug-in that can forward text news and so on. I thought I should write a plug-in in C (a shell as big as C# can sometimes be a headache), but after searching on Google, I was really lucky and found several articles about the development of IE plug-ins. Just use Javascript and add a registry to get it done. Needless to say, the plug-in is written in javascript. The browser itself supports it and no additional installation is required. Adding the registry can be done manually, but it is troublesome, so I wrote a batch process to do it.

1: Add registry: HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMenuExt

Set the default value to the html file path, and add the value Contexts to) 0xf3.

2: code: It is explained in MSDN http://msdn.microsoft.com/en-us/library/aa753589(v=VS.85).aspx. MSDN original text: Set the default value of the key to the URL of the page that contains the script you want the context menu entry to execute. This script can obtain the parent window object, the screen where the context menu item was executed, from the menuArguments property of the external object.

Probably means that we can use the window.external.menuArguments object to obtain internal information, such as commonly used objects such as window and document. So we can start work immediately, and it will be done in a few minutes (the code is very simple, just code it directly):

Copy code The code is as follows:




Look at an effect:

A few simple lines of JS Code to implement IE mail forwarding to Sina Weibo_javascript skills

Disadvantages: Just simple acquisition here Regarding the content of the lower text value, I haven't found a way to get the selected html or object. I am looking for it. If you know it, please feel free to enlighten me. My plan is to parse out videos, pictures, etc. and send them.

Download [Click directly to run the batch process and restart IE]

References:

http://msdn.microsoft.com /en-us/library/aa753589(v=VS.85).aspx
http://blogs.msdn.com/b/oldnewthing/archive/2004/05/24/140283. aspx
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn