Web Inspector: improve pre-filled bugzilla link on Uncaught Exception reporter sheet
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Dec 2015 03:01:04 +0000 (03:01 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Dec 2015 03:01:04 +0000 (03:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152402

Reviewed by Joseph Pecoraro.

Include the UA string, inspected page URL, and a template that includes
steps to reproduce and notes. Other common headings (regression, expected,
results, summary) are omitted because they are unlikely to be known when
an uncaught exception occurs, or are obvious ("shouldn't throw exception").

* UserInterface/Debug/UncaughtExceptionReporter.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194427 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js

index 01e86b9..1ba6d7f 100644 (file)
@@ -1,3 +1,17 @@
+2015-12-27  Brian Burg  <bburg@apple.com>
+
+        Web Inspector: improve pre-filled bugzilla link on Uncaught Exception reporter sheet
+        https://bugs.webkit.org/show_bug.cgi?id=152402
+
+        Reviewed by Joseph Pecoraro.
+
+        Include the UA string, inspected page URL, and a template that includes
+        steps to reproduce and notes. Other common headings (regression, expected,
+        results, summary) are omitted because they are unlikely to be known when
+        an uncaught exception occurs, or are obvious ("shouldn't throw exception").
+
+        * UserInterface/Debug/UncaughtExceptionReporter.js:
+
 2015-12-21  Nikita Vasilyev  <nvasilyev@apple.com>
 
         WebInspector: Can't open a new tab: Uncaught Exception: TypeError: this.isNewTabWithTypeAllowed is not a function
index 0c5312c..578ba05 100644 (file)
@@ -136,9 +136,30 @@ function createErrorSheet() {
             dismissErrorSheet();
     }
 
+    let inspectedPageURL = "(unknown)";
+    try {
+        inspectedPageURL = WebInspector.frameResourceManager.mainFrame.url;
+    } catch (e) { }
+
     let formattedErrorDetails = window.__uncaughtExceptions.map((entry) => `${entry.message} (at ${entry.url}:${entry.lineNumber}:${entry.columnNumber})`);
     let detailsForBugReport = formattedErrorDetails.map((line) => ` - ${line}`).join("\n");
-    let encodedBugDescription = encodeURIComponent(`Loading completed: ${loadCompleted ? "true" : "false"}\nUncaught exceptions:\n${detailsForBugReport}`);
+    let encodedBugDescription = encodeURIComponent(`-------
+Auto-generated details:
+
+Inspected URL:        ${inspectedPageURL}
+Loading completed:    ${!!loadCompleted}
+Frontend User Agent:  ${window.navigator.userAgent}
+Uncaught exceptions:
+${detailsForBugReport}
+-------
+
+* STEPS TO REPRODUCE
+1. What were you doing? Include setup or other preparations to reproduce the exception.
+2. Include explicit, accurate, and minimal steps taken. Do not include extraneous or irrelevant steps.
+
+* NOTES
+Document any additional information that might be useful in resolving the problem, such as screen shots or other included attachments.
+`);
     let encodedBugTitle = encodeURIComponent(`Uncaught Exception: ${firstException.message}`);
     let prefilledBugReportLink = `https://bugs.webkit.org/enter_bug.cgi?alias=&assigned_to=webkit-unassigned%40lists.webkit.org&attach_text=&blocked=&bug_file_loc=http%3A%2F%2F&bug_severity=Normal&bug_status=NEW&comment=${encodedBugDescription}&component=Web%20Inspector&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&dependson=&description=&flag_type-1=X&flag_type-3=X&form_name=enter_bug&keywords=&op_sys=All&priority=P2&product=WebKit&rep_platform=All&short_desc=${encodedBugTitle}&version=WebKit%20Nightly%20Build`;
     let detailsForHTML = formattedErrorDetails.map((line) => `<li>${insertWordBreakCharacters(line)}</li>`).join("\n");