Browser addListener not working
See original GitHub issueHello I have problem I test Capacitor on my App and I want run browser and use addListner to observe change url.
I have this code:
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angular';
import { Plugins } from '@capacitor/core';
const { Browser } = Plugins;
export class HomePage {
constructor(){
Browser.addListener("browserFinished", (info: any) => {
console.log(info.url);
})
}
async openWebpage(url: string) {
await Plugins.Browser.open({ url: 'http://capacitor.ionicframework.com/' });
}
}
When I pushed the button, Browser Start but addListener don’t give me event with console.log.
Please tell me what is wrong.
Ionic 4.10.3 but project is created on ionic 3 Cordova 8.1.2 (cordova-lib@8.1.1)
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
browser.menus.onClicked.addListener not working in Firefox
I've found a solution - browser.menus.onClicked.addListener() working properly, just there is a necessity to enable logging in browser ...
Read more >Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >MV3: chrome.action.onClicked.addListener not working?
I found a 2019 conversation (https://groups.google.com/a/chromium.org/g/chromium-extensions/c/9WqUFsURnsc) that this was not working but ...
Read more >Window: load event - Web APIs - MDN Web Docs - Mozilla
Note: All events named load will not propagate to Window ... Use the event name in methods like addEventListener() , or set an...
Read more >Events | Maps JavaScript API - Google Developers
JavaScript within the browser is event driven, meaning that JavaScript responds to ... MVC events, for example, do not pass arguments within their...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is such a fundamental missing thing from Capacitor - for example when you need to take the user to a site to perform some action and then help them return to the app when completed. The inappbrowser in cordova was very widely used to support this. I understand why you keep closing the ticket because it is an inconvenience to incorporate a non-chrome based browser, but this is such a pain in the *ss for so many of us, for so long, it is really hindering the uptake of capacitor. A plea to the Ionicframework folks: make @ionic-enterprise/inappbrowser available to all!
cordova-plugin-inappbrowser
is not always a correct alternative. As in many case, we need camera and microphone permission in the in-app browser. Unfortunately, theWebView
doesn’t support the required permissions and hence certain features can’t work.It will be great to just support a
urlChangeListener
in the capacitor browser plugin.