Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma Mobile
Angelfish
Commits
57053f35
Commit
57053f35
authored
Feb 19, 2020
by
Rinigus Saar
Committed by
Jonah Brüchert
Feb 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
follow requested URL when interacting with user
parent
94181d23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
12 deletions
+27
-12
src/contents/ui/ListWebView.qml
src/contents/ui/ListWebView.qml
+5
-5
src/contents/ui/Navigation.qml
src/contents/ui/Navigation.qml
+4
-4
src/contents/ui/NavigationEntrySheet.qml
src/contents/ui/NavigationEntrySheet.qml
+1
-2
src/contents/ui/WebView.qml
src/contents/ui/WebView.qml
+17
-1
No files found.
src/contents/ui/ListWebView.qml
View file @
57053f35
...
...
@@ -44,7 +44,10 @@ Repeater {
id
:
tabsModel
isMobileDefault
:
Kirigami
.
Settings
.
isMobile
privateMode
:
privateTabsMode
Component.onCompleted
:
tabsModel
.
loadInitialTabs
()
Component.onCompleted
:
{
tabsModel
.
loadInitialTabs
();
loadTabsModel
();
}
signal
loadTabsModel
()
}
...
...
@@ -55,7 +58,6 @@ Repeater {
top
:
tabs
.
top
}
privateMode
:
tabs
.
privateTabsMode
url
:
"
about:empty
"
userAgent.isMobile
:
model
.
isMobile
width
:
tabs
.
width
...
...
@@ -70,9 +72,7 @@ Repeater {
}
}
onUrlChanged
:
{
tabsModel
.
setUrl
(
index
,
url
);
}
onRequestedUrlChanged
:
tabsModel
.
setUrl
(
index
,
requestedUrl
)
Component.onCompleted
:
url
=
model
.
pageurl
...
...
src/contents/ui/Navigation.qml
View file @
57053f35
...
...
@@ -108,7 +108,7 @@ Item {
Layout.fillWidth
:
true
Layout.preferredHeight
:
layout
.
height
property
string
scheme
:
UrlUtils
.
urlScheme
(
currentWebView
.
u
rl
)
property
string
scheme
:
UrlUtils
.
urlScheme
(
currentWebView
.
requestedU
rl
)
Controls.ToolButton
{
id
:
schemeIcon
...
...
@@ -138,12 +138,12 @@ Item {
text
:
{
if
(
labelItem
.
scheme
===
"
http
"
||
labelItem
.
scheme
===
"
https
"
)
{
var
h
=
UrlUtils
.
urlHostPort
(
currentWebView
.
u
rl
);
var
p
=
UrlUtils
.
urlPath
(
currentWebView
.
u
rl
);
var
h
=
UrlUtils
.
urlHostPort
(
currentWebView
.
requestedU
rl
);
var
p
=
UrlUtils
.
urlPath
(
currentWebView
.
requestedU
rl
);
if
(
p
===
"
/
"
)
p
=
""
return
'
%1<font size="2">%2</font>
'
.
arg
(
h
).
arg
(
p
);
}
return
currentWebView
.
u
rl
;
return
currentWebView
.
requestedU
rl
;
}
textFormat
:
Text
.
StyledText
elide
:
Text
.
ElideRight
...
...
src/contents/ui/NavigationEntrySheet.qml
View file @
57053f35
...
...
@@ -74,7 +74,6 @@ Controls.Drawer {
Layout.fillWidth
:
true
clip
:
true
focus
:
false
text
:
currentWebView
.
url
selectByMouse
:
true
Kirigami.Theme.inherit
:
true
...
...
@@ -136,7 +135,7 @@ Controls.Drawer {
// check if the drawer was just slightly slided
if
(
openedState
)
return
;
openedState
=
true
;
urlInput
.
text
=
currentWebView
.
u
rl
;
urlInput
.
text
=
currentWebView
.
requestedU
rl
;
urlInput
.
forceActiveFocus
();
urlInput
.
selectAll
();
listView
.
positionViewAtBeginning
();
...
...
src/contents/ui/WebView.qml
View file @
57053f35
...
...
@@ -42,6 +42,11 @@ WebEngineView {
property
bool
reloadOnVisible
:
true
// URL that was requested and should be used
// as a base for user interaction. It reflects
// last request (successful or failed)
property
url
requestedUrl
:
url
UserAgentGenerator
{
id
:
userAgent
onUserAgentChanged
:
webEngineView
.
reload
()
...
...
@@ -166,9 +171,15 @@ WebEngineView {
}
if
(
loadRequest
.
status
===
WebEngineView
.
LoadFailedStatus
)
{
print
(
"
Load failed:
"
+
loadRequest
.
errorCode
+
"
"
+
loadRequest
.
errorString
);
print
(
"
Load failed url:
"
+
loadRequest
.
url
+
"
"
+
url
);
ec
=
loadRequest
.
errorCode
;
es
=
loadRequest
.
errorString
;
thumb
.
source
=
""
;
// update requested URL only after its clear that it fails.
// Otherwise, its updated as a part of url property update.
if
(
requestedUrl
!==
loadRequest
.
url
)
requestedUrl
=
loadRequest
.
url
;
}
errorCode
=
ec
;
errorString
=
es
;
...
...
@@ -196,7 +207,12 @@ WebEngineView {
}
}
onUrlChanged
:
thumb
.
source
=
""
onUrlChanged
:
{
if
(
requestedUrl
!==
url
)
{
requestedUrl
=
url
;
}
thumb
.
source
=
""
;
}
onFullScreenRequested
:
{
request
.
accept
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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