nmbug.js: Extract the Gmane article id and convert to a Message-ID
Using some JavaScript gymnastics to look through the available frames
for an article.gmane.org/ URL. For example, we might be on a page
like:
http://thread.gmane.org/gmane.mail.notmuch.general/19055/focus=19056
which is composed of the following frames [1]:
http://news.gmane.org/group/gmane.mail.notmuch.general/thread=19055/force_load=t/focus=19056
http://article.gmane.org/gmane.mail.notmuch.general/19056
http://news.gmane.org/navbar.php?group=gmane.mail.notmuch.general&article=19056&next=19057&prev=19054&newsrc=,19056
Or we might be on the article page directly. There are also permalink
pages (with 'permalink' instead of 'article' available from the
blog-link view), but I'm not worrying about them yet.
[1]: for (var i = 0; i < window.frames.length; i++) {
console.log(window.frames[i].document.URL);
}