refactor: separate WEB_VIEW_ATTRIBUTES / WEB_VIEW_ERROR_MESSAGES (#36972)

This commit is contained in:
Milan Burda 2023-01-25 16:08:46 +01:00 committed by GitHub
parent a9b6041d38
commit 2f79444535
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 71 deletions

View file

@ -1,23 +1,24 @@
export const enum WEB_VIEW_CONSTANTS {
// Attributes.
ATTRIBUTE_NAME = 'name',
ATTRIBUTE_PARTITION = 'partition',
ATTRIBUTE_SRC = 'src',
ATTRIBUTE_HTTPREFERRER = 'httpreferrer',
ATTRIBUTE_NODEINTEGRATION = 'nodeintegration',
ATTRIBUTE_NODEINTEGRATIONINSUBFRAMES = 'nodeintegrationinsubframes',
ATTRIBUTE_PLUGINS = 'plugins',
ATTRIBUTE_DISABLEWEBSECURITY = 'disablewebsecurity',
ATTRIBUTE_ALLOWPOPUPS = 'allowpopups',
ATTRIBUTE_PRELOAD = 'preload',
ATTRIBUTE_USERAGENT = 'useragent',
ATTRIBUTE_BLINKFEATURES = 'blinkfeatures',
ATTRIBUTE_DISABLEBLINKFEATURES = 'disableblinkfeatures',
ATTRIBUTE_WEBPREFERENCES = 'webpreferences',
// Error messages.
ERROR_MSG_ALREADY_NAVIGATED = 'The object has already navigated, so its partition cannot be changed.',
ERROR_MSG_INVALID_PARTITION_ATTRIBUTE = 'Invalid partition attribute.',
ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE = 'Only "file:" protocol is supported in "preload" attribute.',
ERROR_MSG_NOT_ATTACHED = 'The WebView must be attached to the DOM and the dom-ready event emitted before this method can be called.'
export const enum WEB_VIEW_ATTRIBUTES {
NAME = 'name',
PARTITION = 'partition',
SRC = 'src',
HTTPREFERRER = 'httpreferrer',
NODEINTEGRATION = 'nodeintegration',
NODEINTEGRATIONINSUBFRAMES = 'nodeintegrationinsubframes',
PLUGINS = 'plugins',
DISABLEWEBSECURITY = 'disablewebsecurity',
ALLOWPOPUPS = 'allowpopups',
PRELOAD = 'preload',
USERAGENT = 'useragent',
BLINKFEATURES = 'blinkfeatures',
DISABLEBLINKFEATURES = 'disableblinkfeatures',
WEBPREFERENCES = 'webpreferences',
}
export const enum WEB_VIEW_ERROR_MESSAGES {
// Error messages.
ALREADY_NAVIGATED = 'The object has already navigated, so its partition cannot be changed.',
INVALID_PARTITION_ATTRIBUTE = 'Invalid partition attribute.',
INVALID_PRELOAD_ATTRIBUTE = 'Only "file:" protocol is supported in "preload" attribute.',
NOT_ATTACHED = 'The WebView must be attached to the DOM and the dom-ready event emitted before this method can be called.'
}