This repository has been archived on 2023-11-19. You can view files and clone it, but cannot push or open issues or pull requests.
goober-bb10/assets/WebViewSheet.qml
2019-08-03 16:39:00 -07:00

30 lines
No EOL
969 B
QML

import bb.cascades 1.4
Sheet {
peekEnabled: false
property alias url: webview.url
property bool authredir: true
Page {
ScrollView {
scrollViewProperties.pinchToZoomEnabled: true
scrollViewProperties.scrollMode: ScrollMode.Both
WebView {
id: webview
settings.zoomToFitEnabled: true
onUrlChanged: {
// console.log("::" + url)
// Workaround for 10.3.3
if (authredir === true) {
if (url.toString().match(/http\:\/\/.*#access_token\=/i)) {
// console.log("Matched url: " + url.toString());
webview.stop();
webview.url = url.toString();
authredir = false;
}
}
}
}
}
}
}