Search code examples
ionic-frameworkcapacitorchrome-custom-tabs

Chrome Custom Tab support in capacitor


Is there any way to make Browser Tab work with a capacitor react project. I found that it's supported in ionic. I'm relatively new to ionic and capacitor. I'm trying to use this ionic plugin in my react capacitor https://ionicframework.com/docs/intro/cli

but I'm getting this error

Module not found: Can't resolve '@angular/core' in '/Users/userid/Desktop/projectname-irc/node_modules/@ionic-native/browser-tab'

Solution

  • I found custom tabs are not part of capacitor docs, but they were working through BrowserOptions passes in Browser.open method.

        function openInBrowserTab() {
            Browser.open({ url: 'https://www.google.com/', presentationStyle: 'popover', windowName: '_self' });
        }
    

    https://capacitorjs.com/docs/v2/apis/browser#open