java.lang.Object
org.htmlunit.csp.CspQueriesInOrigin
- Direct Known Subclasses:
PolicyInOrigin,PolicyListInOrigin
Convenience wrapper that pairs a
CspQueries target with an
origin, supplying simplified query methods that
fill in the origin and leave unused parameters empty.
Use PolicyInOrigin or PolicyListInOrigin when a typed
accessor for the underlying Policy / PolicyList is needed.
- Since:
- 5.4.0
- Author:
- Ronald Brill, Rick Mitchell
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether a connection to the given URL is allowed.booleanReturns whether eval is allowed.booleanReturns whether a font from the given URL is allowed.booleanReturns whether a form action to the given URL is allowed.booleanReturns whether the given frame ancestor is allowed.booleanReturns whether a frame from the given URL is allowed.booleanReturns whether an image from the given URL is allowed.booleanReturns whether an application manifest from the given URL is allowed.booleanReturns whether media from the given URL is allowed.booleanReturns whether navigation to the given URL is allowed.booleanReturns whether an object from the given URL is allowed.booleanReturns whether a prefetch from the given URL is allowed.booleanReturns whether an external script from the given URL is allowed.booleanReturns whether an external stylesheet from the given URL is allowed.booleanReturns whether unsafe inline script is allowed.booleanReturns whether unsafe inline style is allowed.booleanReturns whether a worker from the given URL is allowed.Returns the underlying origin.Returns the underlying query target.
-
Constructor Details
-
CspQueriesInOrigin
Ctor.- Parameters:
queries- the query target (PolicyorPolicyList)origin- the origin of the protected resource- Throws:
NullPointerException- ifqueriesororiginisnull
-
-
Method Details
-
getQueries
Returns the underlying query target.- Returns:
- the
CspQueriesassociated with this wrapper
-
getOrigin
Returns the underlying origin.- Returns:
- the origin of the protected resource
-
allowsScriptFromSource
Returns whether an external script from the given URL is allowed.- Parameters:
url- the URL of the external script- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsStyleFromSource
Returns whether an external stylesheet from the given URL is allowed.- Parameters:
url- the URL of the external stylesheet- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsImageFromSource
Returns whether an image from the given URL is allowed.- Parameters:
url- the URL of the image resource- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsFrameFromSource
Returns whether a frame from the given URL is allowed.- Parameters:
url- the URL of the framed resource- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsWorkerFromSource
Returns whether a worker from the given URL is allowed.- Parameters:
url- the URL of the worker script- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsFontFromSource
Returns whether a font from the given URL is allowed.- Parameters:
url- the URL of the font resource- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsObjectFromSource
Returns whether an object from the given URL is allowed.- Parameters:
url- the URL of the object resource- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsMediaFromSource
Returns whether media from the given URL is allowed.- Parameters:
url- the URL of the media resource- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsManifestFromSource
Returns whether an application manifest from the given URL is allowed.- Parameters:
url- the URL of the manifest resource- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsPrefetchFromSource
Returns whether a prefetch from the given URL is allowed.- Parameters:
url- the URL to prefetch- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsUnsafeInlineScript
public boolean allowsUnsafeInlineScript()Returns whether unsafe inline script is allowed.- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsUnsafeInlineStyle
public boolean allowsUnsafeInlineStyle()Returns whether unsafe inline style is allowed.- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsEval
public boolean allowsEval()Returns whether eval is allowed.- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsConnection
Returns whether a connection to the given URL is allowed.- Parameters:
url- the URL to connect to- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsFrameAncestor
Returns whether the given frame ancestor is allowed.- Parameters:
url- the URL of the ancestor frame- Returns:
trueif allowed under this query target's rules- See Also:
-
allowsFormAction
Returns whether a form action to the given URL is allowed.- Parameters:
url- the form action target URL- Returns:
trueif allowed under this query target's rules- See Also:
-