English 中文(简体)
Extract part of an url using a bookmarklet or similar (e.g. firefox addon)
原标题:

Does anybody know of a bookmarklet or firefox addon that let s you extract part of an url.

Specifically I want to extract the message id from a gmail conversation. Every message in gmail has a unique ID. The url may look like this: https://mail.google.com/a/domain.com/#all/1251b8f40722a3c2

What I want, is to be able to extract the last 16 characters (the "1251b8f40722a3c2" part) from the url and have it copied to the clipboard automatically.

A bookmarklet would be preferred (compatibility), but a firefox addon is also okay.

Thank you! :)

最佳回答

Forgot all about this question. I got this answer from someone, I can t remember who. But maybe it will help someone else in my situation.

javascript:(function(){var%20theSnippedURL=location.href.match(/([0-9]|[a-f]){16}/g);if(theSnippedURL){var%20url=prompt(%22Copy%20the%20extracted%20ID%20below.%22,theSnippedURL);}else{alert(%22Couldn t%20find%20conversation%20ID.%22);}})();

This javascript can be used in a bookmarklet like this. It extracts the message ID from Gmail, and shows it in a popup box. Unfortunatly it doesn t copy the ID to the clipboard, but you can just copy it from the popup, so that s ok.

问题回答

暂无回答




相关问题
how does gmail detect mouse movement?

if you are inactive on gmail, by not moving your mouse for a while, it changes your chat status to orange which means idle. but when you start moving the mouse again it turns it back to green meaning ...

reading mails using python

how do i read mails from my mail box using python?? import getpass, imaplib M = imaplib.IMAP4( IMAP4.gmail.com:993 ) M.login(getpass.getuser(), getpass.getpass()) M.select() typ, data = M.search(None,...

SMTP Service not available

I am trying to create a web application which upon entering your email address and message , sends an email with this information from the email address. I used this: try { ...

How to auto log into gmail atom feed with Python?

Gmail has this sweet thing going on to get an atom feed: def gmail_url(user, pwd): return "https://"+str(user)+":"+str(pwd)+"@gmail.google.com/gmail/feed/atom" Now when you do this in a browser, ...

Can I build an addin for Gmail?

Is there a way I can create an addin for my Gmail account? Is GreaseMonkey the only real way? I use Gmail for customer service, and I d like to create a tool that looks up the customer and preps a ...

Web Link in a mail is not rendering as link in yahoo

string from = "abc@gmail.com"; string to = "xyz@gmail.com,xyz@yahoo.co.in"; string password="abcxyz"; MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(to); mail.From = new ...

热门标签