summaryrefslogtreecommitdiffstats
path: root/examples/webengine/quicknanobrowser/BrowserWindow.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webengine/quicknanobrowser/BrowserWindow.qml')
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml41
1 files changed, 25 insertions, 16 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index 5e98997ee..fc9cd0253 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -206,8 +206,12 @@ ApplicationWindow {
enabled: model.offset
}
- onObjectAdded: historyMenu.insertItem(index, object)
- onObjectRemoved: historyMenu.removeItem(object)
+ onObjectAdded: function(index, object) {
+ historyMenu.insertItem(index, object)
+ }
+ onObjectRemoved: function(index, object) {
+ historyMenu.removeItem(object)
+ }
}
}
}
@@ -291,14 +295,18 @@ ApplicationWindow {
text: "Off The Record"
checkable: true
checked: currentWebView.profile.offTheRecord
- onToggled: currentWebView.profile = checked ? otrProfile : defaultProfile;
+ onToggled: function(checked) {
+ currentWebView.profile = checked ? otrProfile : defaultProfile;
+ }
}
MenuItem {
id: httpDiskCacheEnabled
text: "HTTP Disk Cache"
checkable: !currentWebView.profile.offTheRecord
checked: (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache)
- onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache
+ onToggled: function(checked) {
+ currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache;
+ }
}
MenuItem {
id: autoLoadIconsForPage
@@ -368,8 +376,8 @@ ApplicationWindow {
id: webEngineView
focus: true
- onLinkHovered: {
- if (hoveredUrl == "")
+ onLinkHovered: function(hoveredUrl) {
+ if (hoveredUrl === "")
resetStatusText.start();
else {
resetStatusText.stop();
@@ -400,22 +408,22 @@ ApplicationWindow {
settings.touchIconsEnabled: appSettings.touchIconsEnabled
settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly
- onCertificateError: {
+ onCertificateError: function(error) {
error.defer();
sslDialog.enqueue(error);
}
- onNewViewRequested: {
+ onNewViewRequested: function(request) {
if (!request.userInitiated)
print("Warning: Blocked a popup window.");
- else if (request.destination == WebEngineView.NewViewInTab) {
+ else if (request.destination === WebEngineView.NewViewInTab) {
var tab = tabs.createEmptyTab(currentWebView.profile);
tabs.currentIndex = tabs.count - 1;
request.openIn(tab.item);
- } else if (request.destination == WebEngineView.NewViewInBackgroundTab) {
+ } else if (request.destination === WebEngineView.NewViewInBackgroundTab) {
var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
request.openIn(backgroundTab.item);
- } else if (request.destination == WebEngineView.NewViewInDialog) {
+ } else if (request.destination === WebEngineView.NewViewInDialog) {
var dialog = applicationRoot.createDialog(currentWebView.profile);
request.openIn(dialog.currentWebView);
} else {
@@ -424,7 +432,7 @@ ApplicationWindow {
}
}
- onFullScreenRequested: {
+ onFullScreenRequested: function(request) {
if (request.toggleOn) {
webEngineView.state = "FullScreen";
browserWindow.previousVisibility = browserWindow.visibility;
@@ -438,19 +446,20 @@ ApplicationWindow {
request.accept();
}
- onQuotaRequested: {
+ onQuotaRequested: function(request) {
if (request.requestedSize <= 5 * 1024 * 1024)
request.accept();
else
request.reject();
}
- onRegisterProtocolHandlerRequested: {
- print("accepting registerProtocolHandler request for " + request.scheme + " from " + request.origin);
+ onRegisterProtocolHandlerRequested: function(request) {
+ console.log("accepting registerProtocolHandler request for "
+ + request.scheme + " from " + request.origin);
request.accept();
}
- onRenderProcessTerminated: {
+ onRenderProcessTerminated: function(terminationStatus, exitCode) {
var status = "";
switch (terminationStatus) {
case WebEngineView.NormalTerminationStatus: