Skip to content

Commit 3cb17d2

Browse files
committed
Exclude queries and hash fragments from URLs
1 parent b96dbf0 commit 3cb17d2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/constants.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const base = new URL(location.href).origin;
12
export const SHARE_TARGET_PICKER_FIXED_ARGUMENT_LIST = [
23
{
34
label: 'text',
@@ -18,24 +19,24 @@ export const SHARE_TARGET_PICKER_FIXED_ARGUMENT_LIST = [
1819
label: 'image',
1920
value: {
2021
type: 'image',
21-
originalContentUrl: `${location.href}assets/stp_image.png`,
22-
previewImageUrl: `${location.href}assets/stp_image.png`,
22+
originalContentUrl: `${base}/assets/stp_image.png`,
23+
previewImageUrl: `${base}/assets/stp_image.png`,
2324
},
2425
},
2526
{
2627
label: 'video',
2728
value: {
2829
type: 'video',
29-
originalContentUrl: `${location.href}assets/stp_video.mp4`,
30-
previewImageUrl: `${location.href}assets/stp_video.mp4`,
30+
originalContentUrl: `${base}/assets/stp_video.mp4`,
31+
previewImageUrl: `${base}/assets/stp_video.mp4`,
3132
trackingId: 'track-id',
3233
},
3334
},
3435
{
3536
label: 'audio',
3637
value: {
3738
type: 'audio',
38-
originalContentUrl: `${location.href}assets/stp_audio.mp3`,
39+
originalContentUrl: `${base}/assets/stp_audio.mp3`,
3940
duration: 60000,
4041
},
4142
},

0 commit comments

Comments
 (0)