Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make changeset page title to include a summary of changes. closes #1

  • Loading branch information...
commit ee79240b4dbf5b71a2c564eed5a123a6cfb16b9b 1 parent 234d289
@myakura authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 content.js
View
23 content.js
@@ -0,0 +1,23 @@
+(function () {
+ var msgelem = document.querySelector('dd.message p'),
+ msgtext = msgelem.textContent,
+ reurls = /https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=\d+|<\s*(?:https?:\/\/webkit\.org\/b|rdar:\/\/problem)\/\d+>/g;
+
+ /*
+ bugzilla : /https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=\d+/g,
+ shortered: /<\s*https?:\/webkit\.org\/b\/\d+>/g;
+ rdar url : /<\s*rdar:\/\/problem\/\d+>/g,
+ // might need ones for wkb.ug and wkbug.com someday.
+ */
+
+ // remove wk bug and rdar urls, then trim.
+ msgtext = msgtext.replace(reurls, '').trim();
+
+ // if there are multiple "paragraphs" in the element, grab the first one
+ if (/\s+\n/.test(msgtext)) {
+ msgtext = msgtext.split(/\s+\n/)[0];
+ }
+
+ document.title += '' + msgtext.replace(/\n/,' ');
+}());
+
Please sign in to comment.
Something went wrong with that request. Please try again.