cordova-plugin-themeablebrowser icon indicating copy to clipboard operation
cordova-plugin-themeablebrowser copied to clipboard

unable to hide

Open anup5708 opened this issue 9 years ago • 6 comments

I am getting error as ref.hide is not a function

See my code.

var ref = cordova.ThemeableBrowser.open('abc.com', '_blank', { statusbar: { color: '#ffffffff' }, toolbar: { height: 44, color: '#004387' }, title: { color: '#ffffffff', showPageTitle: true }, customButtons: [ { wwwImage: 'img/home.png', wwwImagePressed: 'home_pressed', align: 'right', event: 'homePressed' } ], backButtonCanClose: true, hidden:true }); ref.addEventListener('loadstart', function (e) { $ionicLoading.show({ template: '

Please wait...

' }); }); ref.addEventListener('loadstop', function (event) { ref.show(); $ionicLoading.hide(); }); ref.addEventListener('homePressed', function (event) { ref.hide(); // I am getting error as ref.hide is not a function
        });

anup5708 avatar Dec 30 '16 15:12 anup5708

Any update..??

anup5708 avatar Jan 04 '17 06:01 anup5708

I am getting the same error when trying to hide the browser.


I noticed that there is no setting/way to show a loading bar while navigating in the browser so I decided to hide the browser, show loading bar and show back after loadstop. I am getting the same error when I do so.

jagjitgill avatar Jan 10 '17 21:01 jagjitgill

to anyone interested, pull request #133 solves this.

anothergituser avatar May 04 '17 13:05 anothergituser

Please check below code this works proper for me.

`var ref = cordova.ThemeableBrowser.open('https://abc.com', '_blank', { statusbar: { color: '#ffffffff' }, toolbar: { height: 44, color: '#004387' }, title: { color: '#ffffffff', showPageTitle: true }, customButtons: [ { wwwImage: 'img/whitehome.png', wwwImagePressed: 'home_pressed', align: 'right', event: 'homePressed' } ], backButtonCanClose: true, hidden: true }); ref.addEventListener('loadstart', function (e) { console.log('started'); $ionicLoading.show({ template: '

Please wait...

' });
        });
        ref.addEventListener('loadstop', function (event) {
            ref.show();
            $ionicLoading.hide();
            console.log('loadstop');
        });
        ref.addEventListener('loaderror', function (e) {
            console.log('error while loading');
            $ionicLoading.hide();

        });
        ref.addEventListener('homePressed', function (event) {
            $ionicLoading.hide();
            ref.close();
            $rootScope.indexSlide = "0";
            $state.reload();
            // $state.go('app.qrcodePage');
        });
        // $ionicSlideBoxDelegate.next();

    }`

anup5708 avatar May 08 '17 11:05 anup5708

hello in plugin you need to change the type of hidden: string to -> hidden: boolean image

it works for me (y)

jassiwalia001 avatar Jul 10 '17 14:07 jassiwalia001

node_modules/@ionic-native/themeable-browser/index.d.ts

update ThemeableBrowserOptions update to this

hidden?: boolean;
clearcache?: boolean;
clearsessioncache?: boolean;

should make an PR on ionic native

hiepxanh avatar May 28 '18 07:05 hiepxanh