You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/core/public/kibana-plugin-core-public.applicationstart.geturlforapp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
Returns an URL to a given app, including the global base path. By default, the URL is relative (/basePath/app/my-app). Use the `absolute` option to generate an absolute url (http://host:port/basePath/app/my-app)
8
8
9
-
Note that when generating absolute urls, the protocol, host and port are determined from the browser location.
9
+
Note that when generating absolute urls, the origin (protocol, host and port) are determined from the browser's location.
| [getUrlForApp(appId, options)](./kibana-plugin-core-public.applicationstart.geturlforapp.md) | ReturnsanURLtoagivenapp, includingtheglobalbasepath. Bydefault, theURLisrelative (/basePath/app/my-app). Usethe <code>absolute</code> optiontogenerateanabsoluteurl (http://host:port/basePath/app/my-app)<!-- -->Note that when generating absolute urls, the protocol, host and port are determined from the browser location. |
25
+
| [getUrlForApp(appId, options)](./kibana-plugin-core-public.applicationstart.geturlforapp.md) | ReturnsanURLtoagivenapp, includingtheglobalbasepath. Bydefault, theURLisrelative (/basePath/app/my-app). Usethe <code>absolute</code> optiontogenerateanabsoluteurl (http://host:port/basePath/app/my-app)<!-- -->Note that when generating absolute urls, the origin (protocol, host and port) are determined from the browser's location. |
Navigate to given url, which can either be an absolute url or a relative path, in a SPA friendly way when possible.
8
+
9
+
If all these criteria are true for the given url: - (only for absolute URLs) The origin of the URL matches the origin of the browser's current location - The pathname of the URL starts with the current basePath (eg. /mybasepath/s/my-space) - The pathname segment after the basePath matches any known application route (eg. /app/<id>/ or any application's `appRoute` configuration)
10
+
11
+
Then a SPA navigation will be performed using `navigateToApp` using the corresponding application and path. Otherwise, fallback to a full page reload to navigate to the url using `window.location.assign`
12
+
13
+
<b>Signature:</b>
14
+
15
+
```typescript
16
+
navigateToUrl(url: string): Promise<void>;
17
+
```
18
+
19
+
## Parameters
20
+
21
+
| Parameter | Type | Description |
22
+
| --- | --- | --- |
23
+
| url | <code>string</code> | an absolute url, or a relative path, to navigate to. |
24
+
25
+
<b>Returns:</b>
26
+
27
+
`Promise<void>`
28
+
29
+
## Example
30
+
31
+
32
+
```ts
33
+
// current url: `https://kibana:8080/base-path/s/my-space/app/dashboard`
34
+
35
+
// will call `application.navigateToApp('discover', { path: '/some-path?foo=bar'})`
0 commit comments