Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
Switch to priority inbox. Update for latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Jun 10, 2011
1 parent 22671f6 commit 5aebc6c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions gmail_inbox_reply/script.user.js
@@ -0,0 +1,34 @@
// ==UserScript==
// @name GMail Inbox After Reply
// @namespace http://userscripts.org/users/63868
// @include http://mail.google.com*
// @include https://mail.google.com*
// @require http://updater.usotools.co.cc/38212.js
// @require http://userscripts.org/scripts/source/56812.user.js
// ==/UserScript==

var api = new USO.Gmail()

api.on('view:cv', function () {
this.active_view.addEventListener('DOMNodeInserted', onNodeInsert, false)
})

var onNodeInsert = function onNodeInsert () {
if (api.view !== 'cv') {
return this.removeEventListener('DOMNodeInserted', onNodeInsert, false)
}

var alert = this.ownerDocument.evaluate
( ".//div[contains(., 'Your message has been sent.') "
+ "and @aria-atomic='true' and @aria-live='polite']"
, this
, null
, XPathResult.FIRST_ORDERED_NODE_TYPE
, null
)
.singleNodeValue

if (alert) {
top.location.hash = '#mbox'
}
}

0 comments on commit 5aebc6c

Please sign in to comment.