We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa816fa commit 90df78dCopy full SHA for 90df78d
packages/broadcast/component.js
@@ -15,12 +15,13 @@ export class FabricBroadcast extends FabricWebComponent {
15
16
// Generate url
17
const dev = Boolean(this.getAttribute('dev'));
18
- const url = `https://${dev ? 'dev' : 'www'}.finn.no/broadcasts?path=${
19
- this.getAttribute('url') || window.location.href
20
- }`;
+ const broadcastUrl = `https://${dev ? 'dev' : 'www'}.finn.no/broadcasts`;
+ const pageUrl = this.getAttribute('url') || window.location.href;
+ const url = new URL(broadcastUrl);
21
+ url.searchParams.set('path', pageUrl);
22
23
// Fetch message
- const res = await (await fetch(url)).json();
24
+ const res = await (await fetch(url.href)).json();
25
26
// If response exists
27
if (res.length) {
0 commit comments