QWebSecurityOrigin Class ReferenceThe QWebSecurityOrigin class defines a security boundary for web sites. More... #include <QWebSecurityOrigin> This class was introduced in Qt 4.5. Public Functions
Static Public Members
Detailed DescriptionThe QWebSecurityOrigin class defines a security boundary for web sites. QWebSecurityOrigin provides access to the security domains defined by web sites. An origin consists of a host name, a scheme, and a port number. Web sites with the same security origin can access each other's resources for client-side scripting or databases. For example the site http://www.example.com/my/page.html is allowed to share the same database as http://www.example.com/my/overview.html, or access each other's documents when used in HTML frame sets and JavaScript. At the same time it prevents http://www.malicious.com/evil.html from accessing http://www.example.com/'s resources, because they are of a different security origin. By default local schemes like file:// and qrc:// are concidered to be in the same security origin, and can access each other's resources. You can add additional local schemes by using QWebSecurityOrigin::addLocalScheme(), or override the default same-origin behavior by setting QWebSettings::LocalContentCanAccessFileUrls to false. Note: Local resources are by default restricted from accessing remote content, which means your file:// will not be able to access http://domain.com/foo.html. You can relax this restriction by setting QWebSettings::LocalContentCanAccessRemoteUrls to true. Call QWebFrame::securityOrigin() to get the QWebSecurityOrigin for a frame in a web page, and use host(), scheme() and port() to identify the security origin. Use databases() to access the databases defined within a security origin. The disk usage of the origin's databases can be limited with setDatabaseQuota(). databaseQuota() and databaseUsage() report the current limit as well as the current usage. For more information refer to the "Same origin policy" Wikipedia Article. See also QWebFrame::securityOrigin(). Member Function Documentation
|