Skip to content

Commit 4ec1266

Browse files
authored
Remove URL prefix dropdown from new browser profile screen (#1661)
Related to #1646 Separate PR for 1.9.7, related to #1660 Switch to a text field and prepend `https://` as prefix if no valid prefix is provided.
1 parent cc01300 commit 4ec1266

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

frontend/src/features/browser-profiles/new-browser-profile-dialog.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class NewBrowserProfileDialog extends LiteElement {
4747
@reset=${this.onReset}
4848
@submit=${this.onSubmit}
4949
>
50-
<div class="grid gap-5">
50+
<div class="grid">
5151
<div>
5252
<label
5353
id="startingUrlLabel"
@@ -57,21 +57,10 @@ export class NewBrowserProfileDialog extends LiteElement {
5757
</label>
5858
5959
<div class="flex">
60-
<sl-select
61-
class="mr-1 max-w-[8rem] grow-0"
62-
name="urlPrefix"
63-
value="https://"
64-
hoist
65-
@sl-hide=${this.stopProp}
66-
@sl-after-hide=${this.stopProp}
67-
>
68-
<sl-option value="http://">http://</sl-option>
69-
<sl-option value="https://">https://</sl-option>
70-
</sl-select>
7160
<sl-input
7261
class="grow"
7362
name="url"
74-
placeholder=${msg("example.com")}
63+
placeholder=${msg("https://example.com")}
7564
autocomplete="off"
7665
aria-labelledby="startingUrlLabel"
7766
required
@@ -134,13 +123,15 @@ export class NewBrowserProfileDialog extends LiteElement {
134123
this.isSubmitting = true;
135124

136125
const formData = new FormData(event.target as HTMLFormElement);
137-
const url = formData.get("url") as string;
126+
let url = formData.get("url") as string;
138127

139128
try {
129+
url = url.trim();
130+
if (!url.startsWith("http://") && !url.startsWith("https://")) {
131+
url = `https://${url}`;
132+
}
140133
const data = await this.createBrowser({
141-
url: `${formData.get("urlPrefix")?.toString()}${url.substring(
142-
url.indexOf(",") + 1,
143-
)}`,
134+
url: url,
144135
crawlerChannel: this.crawlerChannel,
145136
});
146137

0 commit comments

Comments
 (0)