Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4023212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:34:16+00:00 2026-05-20T10:34:16+00:00

I’ve developed an extension for firefox and google chrome , safari and ie8+ .

  • 0

I’ve developed an extension for firefox and google chrome, safari and ie8+. It inserts a button into the google mail interface . The button is supposed to insert some custom text into the email footer. It works fine on all of the four if i access the standard google mail address (you can watch it here and here).

Instead, if i access gmail through google apps, it almost all goes down the pipe. The only addon hat works well is the google chrome one. In all the others, the button is correctly added but when i click it this doesn’t add anything into the email footer and produces the following errors.

In firefox i get the following jquery error console:

 Error: Permission denied to access property 'ownerDocument' Source File: chrome://sendsecurefree/content/jquery.js Line: 16

In firebug :

 uncaught exception: [Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: chrome://sendsecurefree/content/jquery.js :: anonymous :: line 16"  data: no] Line 0

Also, in Safari :

 ReferenceError: Can't find variable: toggleEncryptFooter

In internet explorer only composing the mail works, forwarding and replying doesn’t.

Here’s my jquery code that is injected into the gmail webpage :

function toggleEncryptFooter() {

var canvasBody = getGmailCanvasBody();

// get the button element
var documentul = getGmailCanvasDoc();
divul = jQuery(".dX.J-Jw", documentul);      
var encryptButton = divul.find("#encrypt");

//first, check if we already have an encrypt footer
var encryptFooter = jQuery("#encrypt_footer", canvasBody);
if(encryptFooter.length != 0) {
    //we have the footer inserted, delete it
    encryptFooter.remove();

    // style the button to no footer
    encryptButton.html('Enable Encryption');
    encryptButton.removeClass('downer');
    encryptButton.addClass('upper');
} else {
    //add the footer
    var doc = document;
    var head   = jQuery('head', doc);
    var textul = head.find("div#textul",head);

    // text was inserted in injectScript / gmailadder.js into head of canvas_frame
    getGmailCanvasBody().append('<div id="encrypt_footer">' + textul.html() + '</div>');     

    // style the button to footer added
    encryptButton.html('Disable Encryption');
    encryptButton.removeClass('upper');                      
    encryptButton.addClass('downer');
}
}

// gets the head element of the document
function getGmailHead(){
    var doc = document;
    var body = jQuery('head', doc);  
return body;
}

 // gets the body element of the document   
 function getGmailCanvasBody() {
var doc = document;

gmailInst = jQuery("iframe", doc);
    if(gmailInst.length==0) {
        //exit now, we are not on compose
        return null;
}
return gmailInst.contents().find('body');
 }

 // get the document object    
 function getGmailCanvasDoc() {
var doc = document;
var body = jQuery('body', doc);
var canvas_frame = jQuery('iframe#canvas_frame', body);
     if(canvas_frame.length==0) {
         //exit now, we are not on gmail
         return null;
          }

var canvas_doc = canvas_frame[0].contentDocument;

return canvas_doc;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:34:17+00:00Added an answer on May 20, 2026 at 10:34 am

    I had to replace

    gmailInst = jQuery("iframe", doc);
    if(gmailInst.length==0) {
        //exit now, we are not on compose
        return null;
    }
    

    with

    gmailInst = jQuery("iframe.Am.Al", doc);
    if(gmailInst.length==0) {
        //exit now, we are not on compose
        return null;
    }
    

    It seems that in the normal Google mail interface there is only one sub-iframe inside the iframe I’m working in, so gmailInst = jQuery(“iframe”, doc) does its job as long as this condition maintains.

    If i activate a few labs gadgets that are implemented with iframes, then gmailInst = jQuery(“iframe”, doc) passes the first sub-iframe in the list which is probably not the one i’m looking for so i have to use extra filtering: in this case, the class name of the sub-iframe i’m searching.

    Assumptions are devils in disguise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm making a simple page using Google Maps API 3. My first. One marker
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.