Exemplo n.º 1
0
void WebPageGroup::addUserScript(const String& source, const String& baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)
{
    if (source.isEmpty())
        return;

    WebCore::UserScript userScript = WebCore::UserScript(source, (baseURL.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURL)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), injectionTime, injectedFrames);

    m_data.userScripts.append(userScript);
    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserScript(userScript), m_data.pageGroupID);
}
Exemplo n.º 2
0
void WebPageGroup::addUserStyleSheet(const String& source, const String& baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserStyleLevel level)
{
    if (source.isEmpty())
        return;

    WebCore::UserStyleSheet userStyleSheet = WebCore::UserStyleSheet(source, (baseURL.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURL)), toStringVector(whitelist), toStringVector(blacklist), injectedFrames, level);

    m_data.userStyleSheets.append(userStyleSheet);
    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserStyleSheet(userStyleSheet), m_data.pageGroupID);
}
Exemplo n.º 3
0
void WebPageGroup::removeAllUserContentExtensions()
{
    m_data.userContentExtensions.clear();
    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserContentExtensions(), m_data.pageGroupID);
}
Exemplo n.º 4
0
void WebPageGroup::removeUserContentExtension(const String& contentExtensionName)
{
    m_data.userContentExtensions.remove(contentExtensionName);
    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveUserContentExtension(contentExtensionName), m_data.pageGroupID);
}
Exemplo n.º 5
0
void WebPageGroup::addUserContentExtension(const API::UserContentExtension& userContentExtension)
{
    m_data.userContentExtensions.set(userContentExtension.name(), userContentExtension.compiledExtension().data());
    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserContentExtension(userContentExtension.name(), userContentExtension.compiledExtension().data()), m_data.pageGroupID);
}
Exemplo n.º 6
0
void WebPageGroup::removeAllUserContent()
{
    m_data.userStyleSheets.clear();
    m_data.userScripts.clear();
    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserContent(), m_data.pageGroupID);
}