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开发者_Python百科 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.
精彩评论