Skip to content
  • mihaip@chromium.org's avatar
    [Chromium] Allow pushState and related history APIs to be disabled per context · c23704fe
    mihaip@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=99780
    
    Reviewed by Adam Barth.
    
    Source/WebCore:
    
    Chrome Apps do not support the history API (or navigation in general).
    Since pushState is generally feature detected, it's cleanest to disable
    it via a V8 per-context feature, so that applications can have the
    appropriate fallback behavior (other history APIs are re-mapped to throw
    exceptions, since history.back() and the link are not feature detected).
    
    * dom/ContextFeatures.cpp:
    (WebCore::ContextFeatures::pushStateEnabled):
    (WebCore):
    * dom/ContextFeatures.h:
    * dom/Document.cpp:
    (WebCore::Document::enqueuePopstateEvent):
    * page/History.idl:
    
    Source/WebKit/chromium:
    
    Add pushState context feature.
    
    * public/WebPermissionClient.h:
    (WebPermissionClient):
    (WebKit::WebPermissionClient::allowPushState):
    * src/ContextFeaturesClientImpl.cpp:
    (WebKit::ContextFeaturesClientImpl::askIfIsEnabled):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c23704fe