url_schemes.cpp 1.4 KB

1234567891011121314151617181920212223242526
  1. #include "url_schemes.h"
  2. #include <QWebEngineUrlScheme>
  3. static const QByteArray QspWebEngineUrlSchemeName = QByteArrayLiteral("qsp");
  4. static const QByteArray QspExecWebEngineUrlSchemeName = QByteArrayLiteral("exec");
  5. void register_url_schemes()
  6. {
  7. QWebEngineUrlScheme QspWebEngineUrlScheme(QspWebEngineUrlSchemeName);
  8. QspWebEngineUrlScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
  9. QspWebEngineUrlScheme.setFlags(QWebEngineUrlScheme::SecureScheme |
  10. QWebEngineUrlScheme::LocalAccessAllowed |
  11. QWebEngineUrlScheme::ServiceWorkersAllowed |
  12. QWebEngineUrlScheme::ViewSourceAllowed |
  13. QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
  14. QWebEngineUrlScheme::registerScheme(QspWebEngineUrlScheme);
  15. QWebEngineUrlScheme QspExecWebEngineUrlScheme(QspExecWebEngineUrlSchemeName);
  16. QspExecWebEngineUrlScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
  17. QspExecWebEngineUrlScheme.setFlags(QWebEngineUrlScheme::SecureScheme |
  18. QWebEngineUrlScheme::LocalAccessAllowed |
  19. QWebEngineUrlScheme::ServiceWorkersAllowed |
  20. QWebEngineUrlScheme::ViewSourceAllowed |
  21. QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
  22. QWebEngineUrlScheme::registerScheme(QspExecWebEngineUrlScheme);
  23. }