Skip to content

Instantly share code, notes, and snippets.

@richardsondx
Created April 1, 2016 16:13
Show Gist options
  • Save richardsondx/c628d8332f588e50ecb0ed8e2137a435 to your computer and use it in GitHub Desktop.
Save richardsondx/c628d8332f588e50ecb0ed8e2137a435 to your computer and use it in GitHub Desktop.
My app is a chrome extension. (chrome browser). I'm trying to trigger a `SAVE` on the draft in gmail
// compose is the compose window element
// Here I'm clicking the x button on the compose window. But it Doesn't seem to work or trigger a save.
$(compose).find('[aria-label="Save & Close"]').trigger('click');
// select subject to trigger a Save, not sure if that works.
$(compose).find('input[name=subjectbox]').trigger('select');
// Reload Page
$.ajax({
url: window.location.href,
headers: {
"Pragma": "no-cache",
"Expires": -1,
"Cache-Control": "no-cache"
}
}).done(function () {
window.location.reload(true);
});
// close Compose window
$(compose).hide();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment