none
Javascript RRS feed

  • Question

  • I have a FireFox Extension that executes some javascript on certain pages. What would I need to to to make an IE version?  I haven't seen any tutorials around about this.
    Friday, October 19, 2007 9:07 PM

All replies

  • Hi,

    For Command Bar buttons or Menu extensions -

    Just replace references to window and document in your FX extension with external.menuArguments and external.menuArguments.document.

    eg.

    Code Block

     

     

     

     

     

    To add your bookmarklet as a Favorite you have to prefix the javascript with the javascript protocol. Links have no reference to the external object.

    eg. Aribic to English Translation Bookmarklet

     

    Code Block

    [DEFAULT]
    BASEURL=http://www.google.com/translate_buttons?hl=en
    [InternetShortcut]
    URL=javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection%20&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=ar|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=ar|en&tbb=1&ie='+e;};
    IDList=
    [{000214A0-0000-0000-C000-000000000046}]
    Prop3=19,15

     

     

    To get the above to work in IE you need to the asci values with their character equivalents.. %20->{space}

     

    Code Block
    [DEFAULT]
    BASEURL=http://www.google.com/translate_buttons?hl=en
    [InternetShortcut]
    URL=javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection &&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=ar|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=ar|en&tbb=1&ie='+e;};
    IDList=
    [{000214A0-0000-0000-C000-000000000046}]
    Prop3=19,15

     

     

    The Popup blocker may interfer if your FX extension opens scripted windows.

     

    Regards.

     

    Sunday, October 21, 2007 6:15 AM
  • Thanks, but I'm still not sure how i would do this. Is there a general tutorial on creating extensions?

    Also, I want to execute javascript on the web page. Like changing the google logo. Not menus, and that stuff.


    Thanks,

    ari_aaron
    Friday, October 26, 2007 5:06 PM
  • Hi,

     

    MSDN - IE Extension Development - http://msdn2.microsoft.com/en-us/library/aa969320.aspx

     

    Changing the Google Logo

     

    <img alt="Google" height=110 src="/intl/en_au/images/logo.gif" width=276>

     

    The img tag for the logo does not have a class or id attribute, so the only way to change the logo is to examine the DOM with a BHO and find the img tag with the logo image (the first img tag in the document) and replace the img src value.

     

    My usual method for re-branding web pages is to use a User Stylesheet that has custom src values for elements that have a class or id value.

     

    Google offers custom search results pages where you can embed google search results in your own branded web page. See GahooYoogle.com

     

    Regards.

    Saturday, October 27, 2007 8:09 PM
  • That page does  not exist.


    I was using the Google Logo as an example of what i want to do. Basicly DOM stuff. Grab some data on the page, and add some links in.

    Saturday, October 27, 2007 11:53 PM