Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma Mobile
Angelfish
Commits
0c4d2f7b
Verified
Commit
0c4d2f7b
authored
Jul 26, 2019
by
Jonah Brüchert
Browse files
Implement feature permission requests
parent
050ab7e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/WebView.qml
View file @
0c4d2f7b
...
...
@@ -250,4 +250,10 @@ WebEngineView {
authSheet
.
request
=
request
authSheet
.
open
()
}
onFeaturePermissionRequested
:
{
permissionQuestion
.
permission
=
feature
permissionQuestion
.
origin
=
securityOrigin
permissionQuestion
.
visible
=
true
}
}
src/contents/ui/webbrowser.qml
View file @
0c4d2f7b
...
...
@@ -122,7 +122,7 @@ Kirigami.ApplicationWindow {
actions
:
[
Kirigami.Action
{
icon
N
ame
:
"
tab-new
"
icon
.n
ame
:
"
tab-new
"
text
:
i18n
(
"
Open
"
)
onTriggered
:
{
tabs
.
newTab
(
newTabQuestion
.
url
.
toString
())
...
...
@@ -153,7 +153,7 @@ Kirigami.ApplicationWindow {
}
},
Kirigami.Action
{
icon
N
ame
:
"
dialog-cancel
"
icon
.n
ame
:
"
dialog-cancel
"
text
:
i18n
(
"
Cancel
"
)
onTriggered
:
{
downloadQuestion
.
download
.
cancel
()
...
...
@@ -163,6 +163,49 @@ Kirigami.ApplicationWindow {
]
}
Kirigami.InlineMessage
{
property
int
permission
property
string
origin
id
:
permissionQuestion
text
:
{
var
text
=
""
if
(
permission
===
WebEngineView
.
Geolocation
)
text
=
i18n
(
"
geo location
"
)
else
if
(
permission
===
WebEngineView
.
MediaAudioCapture
)
text
=
i18n
(
"
the microphone
"
)
else
if
(
permission
===
WebEngineView
.
MediaVideoCapture
)
text
=
i18n
(
"
the camera
"
)
else
if
(
permission
===
WebEngineView
.
MediaAudioVideoCapture
)
text
=
i18n
(
"
camera and microphone
"
)
i18n
(
"
Do you want to allow the website to access
"
+
text
+
"
?
"
)
}
showCloseButton
:
false
anchors.bottom
:
navigation
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
actions
:
[
Kirigami.Action
{
icon.name
:
"
dialog-ok-apply
"
text
:
i18n
(
"
Accept
"
)
onTriggered
:
{
currentWebView
.
grantFeaturePermission
(
permissionQuestion
.
origin
,
permissionQuestion
.
permission
,
true
)
permissionQuestion
.
visible
=
false
}
},
Kirigami.Action
{
icon.name
:
"
dialog-cancel
"
text
:
i18n
(
"
Decline
"
)
onTriggered
:
{
currentWebView
.
grantFeaturePermission
(
permissionQuestion
.
origin
,
permissionQuestion
.
permission
,
false
)
downloadQuestion
.
visible
=
false
}
}
]
}
// Container for the progress bar
Item
{
id
:
progressItem
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment