Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/browser/qml/pages/components/BookmarkEditDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ UserPromptDialog {
if (!errorHighlight) {
return ""
} else if (text.length > 0) {
var scheme = root.url.match(/^(https?):\/\/.+/)
var scheme = root.url.match(/^([^:]{3,}):/)

//% "URL scheme (%1) missing"
//% "URL scheme (%1) missing or not supported"
return qsTrId("sailfish_browser-la-missing_url_scheme").arg(scheme && scheme.length > 1
? scheme[1] : "https")
} else {
Expand All @@ -112,7 +112,7 @@ UserPromptDialog {
EnterKey.onClicked: accept()

validator: RegExpValidator {
regExp: /^https?:\/\/.+/
regExp: /^(file|https?):\/\/.+/
}
}
}
Expand Down
1 change: 1 addition & 0 deletions apps/browser/qml/pages/components/BookmarkItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ ListItem {
}
MenuItem {
text: qsTrId("sailfish_browser-me-add_to_launcher")
enabled: /^(file|https?):\/\/.+/.test(url) // See also BookmarkEditDialog.qml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a bit misunderstanding, this shouldn't be allowed for generic file urls since those will not be opened with the browser. Exception being .html files. Simplest would be just to require http/https for now.

Furthermore the AddToAppGridDialog inherits BookmarkEditDialog so there should be some property for restricting the validators there to keep on allowing only what we support for the .desktop files as it used to be (with the possible exception of .html files)

onClicked: pageStack.animatorPush("AddToAppGridDialog.qml",
{
"url": url,
Expand Down