Is there a listener that fires whenever a tab notifies the user of an event?
F.e. whenever a message in Whatsapp-Web or any other webapp messenger arrives?
chrome.tabs does not seem to have one as onUpdated does not fire.
Related
I need to send the message to the native host from the Firefox extension when user click on close button.
I have handled the browser.tabs.onRemoved event and sending the message to the native host when this event occurs. It is working fine when user close the tab.
But if user keep open the tab and close Firefox browser window directly then native host does not receive the message.
For Chrome browser it is working fine. We are receiving the message when user close the browser directly. For chrome I have handled the chrome.tabs.onRemoved event.
Does any one have any idea how to handle this scenario?
Thanks.
Is there a way for the backend to detect the webchat disconnected (ie, user closed page, navigated away, browser quited)?
There seems to be no out-of-the-box event for it. We rolled our own event (store.dispatch({...})) and attached it to the beforeunload event, but since it sends a webrequest, thats not supported.
I was thinking about using navigator.sendBeacon, but that will end up with a lot of unwanted events since that should be used on onVisibilityChanged (thus, webchat can still be active, but on a hidden tab). It seems to me that more people would want to know if the enduser is still active.
Using Botframework
I have worked around with RASA + FB messenger.
I'm able to interact with bots on messenger as normal. But when it comes to response as Button (postback). It's not working as I tried to click on response button from bots. If I type it do work.
I check on logs, and local webhook but it got no interaction.
Anyone experience such a case ?
Did you subscribed to postback webhook event in your Developers account?
If not, you have to subscribe for that to receive the postback events.
See the reference: messaging_postbacks Webhook Event Reference
i am implementing pusher with php library for notification system. Everything was running fine until i discovered that including pusher js library fires all the javascript/jQuery events twice. There is a case where admin edits the applicat's details and saves it via ajax request. If i don't include pusher js library it send only one ajax request for saving but if i include pusher library then ajax request are sent twice. i was also having trouble with jQuery toggle() where event is fired twice so instead of showing the content of the div that i applied toggle() event it shows and hide the content of the div in quick succession.
I'm building a Chrome extension that manipulates the content of the page, but the content I'm interested in only shows up when the user has clicked a button and the data has then been loaded from an Ajax call.
At the moment the extension monitors the page with a SetTimeout but it's clumsy.
Can an extension know when an Ajax call has been initiated, and when it ended? or can the extension somehow receive events from the page?
I don't know an easy way to monitor XHR requests, but you can monitor any changes being made to a page structure by listening to DOMSubtreeModified event. So when ajax call is done and elements are added/removed/changed on a page - you will be notified.
document.addEventListener("DOMSubtreeModified", function(event){
//something has changed
});