Skip to content


Extension does not work any more due to changes in Gmail structure #1

jamesmortensen opened this Issue · 1 comment

2 participants


I wasn't sure how to contact you, but I fixed your Random Quotes extension and included the changes here. The changes are all limited to one file.

Note that you may need to update to manifest version 2, as version 1 will soon be discontinued in the Chrome Store.

Below is the bsearch.js file I modified:

var iv_triggered=0;
function insert_quote_in_textarea(textarea, quote) {
//  textarea.value = textarea.value + quote;
    textarea.innerHTML = textarea.innerHTML + quote;
function find_text_area() {
    //var iframe = document.getElementById('canvas_frame');
    //var idoc = iframe.contentDocument;
    //tareas = idoc.getElementsByTagName('textarea');"contents of window = " + document.querySelector('[g_editable="true"]').innerHTML); //('[g_editable="true"]').innerHTML);
       textarea = document.querySelector('[g_editable="true"]');
       return textarea; 

       /*for (var i=0; i < tareas.length; i++) {
        textarea = tareas[i];
        if (textarea.getAttribute && (textarea.getAttribute('id') == ':n4' || textarea.getAttribute('id') == ':1h9' || == 'body' )) {
            return textarea;
    //return null;

function get_quote(textarea) {
    chrome.extension.sendRequest({method: "get_quote"}, function(response) {
        if (response && response.quote) {
            insert_quote_in_textarea(textarea, quote);

var iv = window.setInterval(function() {
    if (window.location.href.indexOf('compose') > 0) {
        if (!iv_triggered) {
            tarea = find_text_area();
            if (tarea) get_quote(textarea);
    } else {
}, 2000);

Also, check my Github profile, I just created a similar extension as I didn't have any luck finding something like this that worked.

Hope this helps!


Hey James,

Thanks for your fix! I actually just noticed your message when I was updating this extension today - sorry about that. The extension should be now compatible with the new Gmail interface.


@raisen raisen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.