Changeset 250243 in webkit


Ignore:
Timestamp:
Sep 23, 2019 11:06:18 AM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Improve the Uncaught Exception View file a bug link
https://bugs.webkit.org/show_bug.cgi?id=201717

Reviewed by Devin Rousso.

Source/WebInspectorUI:

  • UserInterface/Debug/UncaughtExceptionReporter.js:

Allow the link to be clicked. Use openInNewTab on click to also
bring the new tab to the foreground. Also update the content.

Source/WebKit:

  • UIProcess/WebInspectorProxy.cpp:

(WebKit::WebInspectorProxy::bringInspectedPageToFront):

  • UIProcess/WebInspectorProxy.h:
  • UIProcess/WebInspectorProxy.messages.in:

Provide a way to bring the inspected page to the foreground.

  • WebProcess/WebPage/WebInspectorUI.cpp:

(WebKit::WebInspectorUI::openInNewTab):
Use it when opening a new tab beside the inspected page.

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r250152 r250243  
     12019-09-23  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Improve the Uncaught Exception View file a bug link
     4        https://bugs.webkit.org/show_bug.cgi?id=201717
     5
     6        Reviewed by Devin Rousso.
     7
     8        * UserInterface/Debug/UncaughtExceptionReporter.js:
     9        Allow the link to be clicked. Use openInNewTab on click to also
     10        bring the new tab to the foreground. Also update the content.
     11
    1122019-09-20  Devin Rousso  <drousso@apple.com>
    213
  • trunk/Source/WebInspectorUI/UserInterface/Debug/UncaughtExceptionReporter.js

    r248391 r250243  
    244244    let formattedErrorDetails = window.__uncaughtExceptions.map((entry) => formattedEntry(entry));
    245245    let detailsForBugReport = formattedErrorDetails.map((line) => ` - ${line}`).join("\n");
    246     topLevelItems.push("");
    247     topLevelItems.push("Uncaught Exceptions:");
    248     topLevelItems.push(detailsForBugReport);
    249 
    250     let encodedBugDescription = encodeURIComponent(`-------
    251 ${topLevelItems.join("\n")}
    252 -------
    253 
    254 * STEPS TO REPRODUCE
     246
     247    let encodedBugDescription = encodeURIComponent(`Uncaught Exception in Web Inspector.
     248
     249Steps to Reproduce:
    2552501. What were you doing? Include setup or other preparations to reproduce the exception.
    2562512. Include explicit, accurate, and minimal steps taken. Do not include extraneous or irrelevant steps.
    257 
    258 * NOTES
    259 Document any additional information that might be useful in resolving the problem, such as screen shots or other included attachments.
     2523. What did you expect to have happen? What actually happened?
     253
     254Uncaught Exceptions:
     255-----------------------
     256${detailsForBugReport}
     257-----------------------
     258
     259Notes:
     260${topLevelItems.join("\n")}
    260261`);
     262
    261263    let encodedBugTitle = encodeURIComponent(`Uncaught Exception: ${firstException.message}`);
    262264    let encodedInspectedURL = encodeURIComponent(inspectedPageURL || "http://");
    263     let prefilledBugReportLink = `https://bugs.webkit.org/enter_bug.cgi?alias=&assigned_to=webkit-unassigned%40lists.webkit.org&attach_text=&blocked=&bug_file_loc=${encodedInspectedURL}&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`;
     265    let prefilledBugReportLink = `https://bugs.webkit.org/enter_bug.cgi?alias=&assigned_to=webkit-unassigned%40lists.webkit.org&attach_text=&blocked=&bug_file_loc=${encodedInspectedURL}&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}`;
    264266    let detailsForHTML = formattedErrorDetails.map((line) => `<li>${insertWordBreakCharacters(line)}</li>`).join("\n");
    265267
     
    279281        UI, or running an updated frontend with out-of-date WebKit build.</dt>
    280282        <dt>I didn't do anything...?</dt>
    281         <dd>If you don't think you caused this error to happen,
    282         <a href="${prefilledBugReportLink}" target="_blank">click to file a pre-populated
    283         bug with this information</a>. It is possible that someone else broke it by accident.</dd>
     283        <dd><a href="${prefilledBugReportLink}" id="uncaught-exception-bug-report-link" class="bypass-event-blocking">Click to file a bug</a> as this is likely a Web Inspector bug.</dd>
    284284        <dt>Oops, can I try again?</dt>
    285         <dd><a href="javascript:InspectorFrontendHost.reopen()">Click to reload the Inspector</a>
     285        <dd><a href="javascript:InspectorFrontendHost.reopen()" class="bypass-event-blocking">Click to reload the Inspector</a>
    286286        again after making local changes.</dd>
    287287        ${dismissOptionHTML}
     
    296296    sheetElement.addEventListener("click", handleLinkClick, true);
    297297    document.body.appendChild(sheetElement);
     298
     299    document.getElementById("uncaught-exception-bug-report-link").addEventListener("click", (event) => {
     300        InspectorFrontendHost.openInNewTab(prefilledBugReportLink);
     301        event.stopImmediatePropagation();
     302        event.preventDefault();
     303    });
    298304}
    299305
  • trunk/Source/WebKit/ChangeLog

    r250242 r250243  
     12019-09-23  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Improve the Uncaught Exception View file a bug link
     4        https://bugs.webkit.org/show_bug.cgi?id=201717
     5
     6        Reviewed by Devin Rousso.
     7
     8        * UIProcess/WebInspectorProxy.cpp:
     9        (WebKit::WebInspectorProxy::bringInspectedPageToFront):
     10        * UIProcess/WebInspectorProxy.h:
     11        * UIProcess/WebInspectorProxy.messages.in:
     12        Provide a way to bring the inspected page to the foreground.
     13
     14        * WebProcess/WebPage/WebInspectorUI.cpp:
     15        (WebKit::WebInspectorUI::openInNewTab):
     16        Use it when opening a new tab beside the inspected page.
     17
    1182019-09-23  Brent Fulgham  <bfulgham@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp

    r249329 r250243  
    539539}
    540540
     541void WebInspectorProxy::bringInspectedPageToFront()
     542{
     543    platformBringInspectedPageToFront();
     544}
     545
    541546void WebInspectorProxy::attachAvailabilityChanged(bool available)
    542547{
  • trunk/Source/WebKit/UIProcess/WebInspectorProxy.h

    r248177 r250243  
    223223    void didClose();
    224224    void bringToFront();
     225    void bringInspectedPageToFront();
    225226    void attachAvailabilityChanged(bool);
    226227    void inspectedURLChanged(const String&);
  • trunk/Source/WebKit/UIProcess/WebInspectorProxy.messages.in

    r248177 r250243  
    3030    DidClose()
    3131    BringToFront()
     32    BringInspectedPageToFront()
    3233    Reopen()
    3334    ResetState()
  • trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp

    r249808 r250243  
    264264void WebInspectorUI::openInNewTab(const String& url)
    265265{
    266     if (m_backendConnection)
     266    if (m_backendConnection) {
    267267        m_backendConnection->send(Messages::WebInspector::OpenInNewTab(url), 0);
     268        WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::BringInspectedPageToFront(), m_inspectedPageIdentifier);
     269    }
    268270}
    269271
Note: See TracChangeset for help on using the changeset viewer.