MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / openURL

Function openURL

core/src/utils/theme.ts:40–56  ·  view source on GitHub ↗
(
  url: string | undefined | null,
  ev: Event | undefined | null,
  direction: RouterDirection,
  animation?: AnimationBuilder
)

Source from the content-addressed store, hash-verified

38const SCHEME = /^[a-z][a-z0-9+\-.]*:/;
39
40export const openURL = async (
41 url: string | undefined | null,
42 ev: Event | undefined | null,
43 direction: RouterDirection,
44 animation?: AnimationBuilder
45): Promise<boolean> => {
46 if (url != null && url[0] !== '#' && !SCHEME.test(url)) {
47 const router = document.querySelector('ion-router');
48 if (router) {
49 if (ev != null) {
50 ev.preventDefault();
51 }
52 return router.push(url, direction, animation);
53 }
54 }
55 return false;
56};

Callers 7

renderMethod · 0.90
renderMethod · 0.90
RouterLinkClass · 0.90
renderCardMethod · 0.90
ButtonClass · 0.90
BackButtonClass · 0.90
renderMethod · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected