473,666 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE Buttons JavaScript Interaction (like Greasemonkey for FF)

Hi,

I need some help with IE browser programming (in .NET).

I'm trying to add a button to the IE toolbar, and on the click of the
button open a popup window with a remote URL. Secondly, I'm trying to
highlight certain predefined words on particular web sites through the
IE plugin itself.

To add an IE button, I've found this neat article:
http://www.codeproject.com/useritems...EExtension.asp

But I'm stuck with two things:

1. How to open a popup window (IE instance) on the click of the
button? The article above doesn't mention it.

2. How can I include some JavaScript code in the "plugin", so that it
executes some JavaScript code on particular pages (much like the
Greasemonkey extension for Firefox)? I'm aware of a few such tools for
IE (Turnabout, G4IE etc.) which provide Greasemonkey-like
functionality, but I want to build a stand-alone plugin (without any
additional downloads) for the end-user.

Please suggest some ideas on how I can resolve the above two issues.

Thanks in advance!

Jul 4 '07 #1
2 2683
<9i************ *@jetable.orgwr ote in message
news:11******** *************@e 16g2000pri.goog legroups.com
I'm trying to add a button to the IE toolbar, and on the click of the
button open a popup window with a remote URL. Secondly, I'm trying to
highlight certain predefined words on particular web sites through the
IE plugin itself.

To add an IE button, I've found this neat article:
http://www.codeproject.com/useritems...EExtension.asp

But I'm stuck with two things:

1. How to open a popup window (IE instance) on the click of the
button? The article above doesn't mention it.
The article shows a button that runs an executable when clicked. An IE
toolbar button may also be backed by script, or by a COM object. For
details, see

http://msdn2.microsoft.com/en-us/library/aa753588.aspx

In all three cases, you can create a new standalone instance of IE with
CoCreateInstanc e(CLSID_Interne tExplorer) (in case of JavaScript, that
would be new ActiveX("Intern etExplorer.Appl ication"); in case of
VBScript, CreateObject("I nternetExplorer .Application") ). There should
be a .NET equivalent, but I don't know what it is off the top of my
head.

A script can also use window.open, just like the script on the page
would.

A COM object can use an equivalent to window.open. It also can call
IWebBrowser2::N avigate with navOpenInNewWin dow flag.
2. How can I include some JavaScript code in the "plugin", so that it
executes some JavaScript code on particular pages (much like the
Greasemonkey extension for Firefox)?
When you create a toolbar button, you have an option of setting it up to
run a piece of JavaScript when clicked. Is this what you have in mind?

If you want your plugin to work automatically without user intervention,
then toolbar button is a wrong type of extension to implement. You want
a browser helper object (BHO):

http://msdn2.microsoft.com/en-us/library/bb250436.aspx

BHOs can only be implemented as COM components, you can't write one with
script.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Jul 4 '07 #2
Thanks for your suggestions Igor! Very informative!

As part of a project, I'm already looking into building a simple BHO
which executes some JavaScript in the background for certain web
pages. I'm trying to execute the JavaScript in the BHO using the
browsers instance object and using the execScript method for the
object. JavaScript and other DOM access works fine this way, but if I
try to use Ajax (xmlhttp) from the JavaScript, it fails (permission
denied) for obvious cross-domain scripting reasons. I was wondering if
there's any other way (besides writing the Ajax-related code as
managed code in C#) to execute Ajax from within the JavaScript code
that I run using execScript? Please suggest.

Thanks again!

Jul 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
16097
by: Chris Markle | last post by:
Javascript confirm call outputs a dialogue box that writes out a message and gives two choices: OK and Cancel. Can those buttons be relabelled say to "Yes" and "No"?
4
1350
by: jacster | last post by:
Hi, I want to extend the functionality of my Firefox browser. Can you write mozilla plugins in Javascript; can anyone point me to some resources for doing this? If not, can I save Javascript functions as bookmarks and perform read-only operations on remote pages, outputting results to a new window (pop up) client side? Thanks, Malcolm.
2
2237
by: Terry | last post by:
Hi all, I have been googling this problem for many hours... I have the following greasemonkey script; (function() { if (true) { // Change these to match your setup var sabcomputer = "192.168.0.20"; var sabport = "8080";
7
5323
by: unacoder | last post by:
Is it possible to request the user's permission to be able to control IE or FireFox windows that are pointed to domains other than the base domain the script is running from? For example, if my page launches a new window pointing to a web site originating from a different domain, is it possible for my script to request and gain access to the content of that window, and be able to control the window?
3
3073
by: Csaba Gabor | last post by:
Firefox's configuration settings (Prefs.js) can be accomplished via the interface at about:config. Q1. Is there any such setting that can be repeatedly altered via javascript (in a vanilla security environment), without having to request preivileges? By altered, I mean having it remain in effect the next time Firefox is restarted. Q2. If the answer to Q1 is affirmative, is there any such setting that could have an event associated...
4
2204
by: bosky101 | last post by:
alright ive heard a lot about the onclick being needing to be replaced with click ,and some other healthy practices like that . but im still not able to figure out the problem . my click event is not triggered . no error shown in javascript console as well . any idea ? // JavaScript Document window.addEventListener("load", function() { var i=0; draw();
18
2331
by: yusuf | last post by:
I basically want to be able to store and retrieve a tree structure in greasemonkey. Unfortunately the GM_setValue and GM_getValue functions only take string key value pairs. Is there a native javascript function that will serialize the object so that it can be stored and retrieved as strings? Thanks.
5
1207
by: Jeff | last post by:
Hello, I'd like to adapt some Greasemonkey scripts that I've written and have them applied to html files on the server side before the files are sent to users. I'm only looking at adapting scripts that make static changes to pages. For instance, consider a script that removes from the DOM any img that has "ad" in its src. I'm sure there are better ways to do this and I'm not even necessarily looking for an extremely efficient...
8
2953
by: frohlinger | last post by:
Hi, I have a search textbox in my website. I validate the search string with a "white list" of allowed characters: if((/^+$/).test(theSearchWord) == false) { return; }
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.