Created
April 1, 2016 16:13
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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