Skip to content
  • vivek.vg@samsung.com's avatar
    Web Inspector: JavaScript execution disabled by browser/UA should be notified to the front-end · cc349f1f
    vivek.vg@samsung.com authored
    https://bugs.webkit.org/show_bug.cgi?id=109402
    
    Reviewed by Yury Semikhatsky.
    
    Source/WebCore:
    
    Whenever the UA/Browser changes the Script Execution state of a page, it should notify the
    inspector front-end. Added the InspectorInstrumentation method didScriptExecutionStateChange
    to achieve this. Also the state change triggered by the inspector should be ignored to avoid
    infinite loop.
    
    Test: inspector/script-execution-state-change-notification.html
    
    * inspector/Inspector.json:
    * inspector/InspectorInstrumentation.cpp:
    (WebCore):
    (WebCore::InspectorInstrumentation::scriptsEnabledImpl):
    * inspector/InspectorInstrumentation.h:
    (InspectorInstrumentation):
    (WebCore::InspectorInstrumentation::scriptsEnabled):
    (WebCore):
    * inspector/InspectorPageAgent.cpp:
    (WebCore::InspectorPageAgent::InspectorPageAgent):
    (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
    (WebCore::InspectorPageAgent::scriptsEnabled):
    (WebCore):
    * inspector/InspectorPageAgent.h:
    (InspectorPageAgent):
    * inspector/front-end/ResourceTreeModel.js:
    (WebInspector.PageDispatcher.prototype.javascriptDialogClosed):
    (WebInspector.PageDispatcher.prototype.scriptsEnabled):
    * page/Settings.cpp:
    (WebCore::Settings::setScriptEnabled):
    
    LayoutTests:
    
    Tests that whenever Script Execution state is changed outside inspector, its notified to the Inspector front-end.
    
    * inspector/script-execution-state-change-notification-expected.txt: Added.
    * inspector/script-execution-state-change-notification.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    cc349f1f