Skip to content
  • hyatt@apple.com's avatar
    WebCore: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work. · 71960d78
    hyatt@apple.com authored
            
    Reviewed by Adam Roben.
    
    This patch adds new API for adding and removing user scripts from page groups.  User scripts
    are bundled together in isolated worlds (you can have multiple scripts together in the same
    world).
    
    Added userscripts/ directory for holding new tests (along with a simple test of script injection).
    
    * WebCore.base.exp:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * bindings/js/ScriptController.cpp:
    (WebCore::ScriptController::evaluateInIsolatedWorld):
    * bindings/js/ScriptController.h:
    * bindings/v8/ScriptController.cpp:
    (WebCore::ScriptController::evaluateInIsolatedWorld):
    * bindings/v8/ScriptController.h:
    * loader/FrameLoader.cpp:
    (WebCore::FrameLoader::finishedParsing):
    (WebCore::FrameLoader::dispatchDocumentElementAvailable):
    * page/Frame.cpp:
    (WebCore::Frame::injectUserScripts):
    (WebCore::Frame::injectUserScriptsForWorld):
    * page/Frame.h:
    * page/PageGroup.cpp:
    (WebCore::PageGroup::~PageGroup):
    (WebCore::PageGroup::addUserScript):
    (WebCore::PageGroup::removeUserContentForWorld):
    (WebCore::PageGroup::removeAllUserContent):
    * page/PageGroup.h:
    (WebCore::PageGroup::userScripts):
    * page/UserScript.h: Added.
    (WebCore::UserScript::UserScript):
    (WebCore::UserScript::source):
    (WebCore::UserScript::url):
    (WebCore::UserScript::patterns):
    (WebCore::UserScript::worldID):
    (WebCore::UserScript::injectionTime):
    * page/UserScriptTypes.h: Added.
    (WebCore::):
    
    WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work.
            
    Reviewed by Adam Roben.
    
    This patch adds new API for adding and removing user scripts from page groups.  User scripts
    are bundled together in isolated worlds (you can have multiple scripts together in the same
    world).
    
    Added userscripts/ directory for holding new tests (along with a simple test of script injection).
    
    * WebView/WebView.mm:
    (+[WebView _addUserScriptToGroup:source:url:worldID:patterns:injectionTime:]):
    (+[WebView _removeUserContentFromGroup:worldID:]):
    (+[WebView _removeAllUserContentFromGroup:]):
    * WebView/WebViewPrivate.h:
    
    LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work.
            
    Reviewed by Adam Roben.
    
    This patch adds new API for adding and removing user scripts from page groups.  User scripts
    are bundled together in isolated worlds (you can have multiple scripts together in the same
    world).
    
    Added userscripts/ directory for holding new tests (along with a simple test of script injection).
    
    * platform/mac/userscripts: Added.
    * platform/mac/userscripts/script-run-at-end-expected.txt: Added.
    * userscripts: Added.
    * userscripts/script-run-at-end.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    71960d78