Esempio n. 1
0
static bool canAccessDocument(Document* targetDocument, ExceptionState& es)
{
    DOMWindow* activeWindow = activeDOMWindow();
    if (isDocumentAccessibleFromDOMWindow(targetDocument, activeWindow))
        return true;

    es.throwSecurityError(targetDocument->domWindow()->sanitizedCrossDomainAccessErrorMessage(activeWindow), targetDocument->domWindow()->crossDomainAccessErrorMessage(activeWindow));
    return false;
}
Esempio n. 2
0
static bool canAccessDocument(v8::Isolate* isolate, Document* targetDocument, ExceptionState& exceptionState)
{
    DOMWindow* callingWindow = callingDOMWindow(isolate);
    if (isDocumentAccessibleFromDOMWindow(targetDocument, callingWindow))
        return true;

    if (targetDocument->domWindow())
        exceptionState.throwSecurityError(targetDocument->domWindow()->sanitizedCrossDomainAccessErrorMessage(callingWindow), targetDocument->domWindow()->crossDomainAccessErrorMessage(callingWindow));
    return false;
}
Esempio n. 3
0
static bool canAccessDocument(v8::Isolate* isolate, Document* targetDocument, SecurityReportingOption reportingOption = ReportSecurityError)
{
    DOMWindow* callingWindow = callingDOMWindow(isolate);
    if (isDocumentAccessibleFromDOMWindow(targetDocument, callingWindow))
        return true;

    if (reportingOption == ReportSecurityError && targetDocument->domWindow()) {
        if (Frame* frame = targetDocument->frame())
            frame->domWindow()->printErrorMessage(targetDocument->domWindow()->crossDomainAccessErrorMessage(callingWindow));
    }

    return false;
}
Esempio n. 4
0
static bool canAccessDocument(Document* targetDocument, SecurityReportingOption reportingOption = ReportSecurityError)
{
    DOMWindow* activeWindow = activeDOMWindow();
    if (isDocumentAccessibleFromDOMWindow(targetDocument, activeWindow))
        return true;

    if (reportingOption == ReportSecurityError) {
        if (Frame* frame = targetDocument->frame())
            frame->domWindow()->printErrorMessage(targetDocument->domWindow()->crossDomainAccessErrorMessage(activeWindow));
    }

    return false;
}