Is there a way to handle browser back events in an Outlook web-addin? - reactjs

I am developing an Outlook web add-in using React and TypeScript. The add-in is a single-page application and has its own buttons for navigating back and forward. It is loaded as a taskpane in Outlook. The current behavior is that when a user clicks the browser back button while the taskpane is loaded it simply closes.
What I am trying to achieve is that the add-in listens to the back button click in the browser and handles it accordingly i.e. by navigating back within the taskpane rather than closing it.
I have tried listening to 'popstate' events within the React component:
public componentDidMount() {
window.addEventListener('popstate', () => {
console.log("Back button clicked.");
this.props.onBackButtonClicked();
});
}
The problem with this approach is that the 'popstate' event never fires as the taskpane add-in is hosted within an iframe. I have no control over the iframe itself as all Outlook web-addins are hosted within an iframe. I also cannot access the parent window of the iframe as it is on a different domain.
Is there a way for the Outlook web add-in to get notified about users clicking on the browser back button?

Currently, the feature addin getting notified about users clicking on the browser back button, you requested, is not a part of the product. We track Outlook add-in feature requests on our user-voice page. Please add your request there. Feature requests on user-voice are considered when we go through our planning process.

Related

HTML input type=“file” in iframe breaks the file select dialog in Chrome and Edge

I'm working on a React web app that has an iframe component to embed another web app. The parent app has functions to open or close (unmount) the iframe component. And the parent app uses real-time data subscription and it has the behavior to automatically close the iframe when it got a specific event. So it means that the iframe can be closed anytime.
Now onto the problem, both of the apps have input type="file" to upload file. If the iframe got unmounted while I have a "file select dialog" opened from within the iframe, the dialog would still be displayed unless I click the "cancel" button. But the thing is, after closing the file dialog and click Choose File in another input type="file", the file dialog will never show up again unless I refresh the page.
For more info:
the bug won't happen if I run any of the parent or iframe app in localhost, it only happen on the deployed site
Both of the apps is from same domain but with different pathname (ex. https://hello.com/parent and https://hello.com/iframe)
I'm not sure if this is a Chromium bug because it happens in Google Chrome and MS Edge, but not in Safari and Firefox.

Unable to prevent browser back click after redirection

I'm Using Next.js in my project. I am having payment option in my application., Once I got redirected from the Payment gateway I want to stop user clicking browser back button.
currently, If user click browser back buton it goes back to payment gateway.
I am using next-routesfor routing, redux for state management.,
I tried to stop browser back navigation with this package disable-browser-back-navigation, but the issue remains same.
can anyone help me on this.

Disable popup blocker in firefox

From one of our application, we are calling window.open() method to open a pop up. When we are using this, the browsers are blocking the popup and user has to disable popup blocker for the specified web site.
Is there any way to disable the popup blockers for specified URL patterns(With out user intervention),like using browser API etc...
No. There is no way to alter the browser's popup blocker behaviour from within a webpage. The best you can do is include a message on your website asking people to turn off their popup blockers while using your site so that the site can function properly.

Silverlight and the back button

Is there a way to override the behavior of the back button in the browser when using a Silverlight app?
Essentially what I want to do is use the browser's back button to close dialogs in my application. The dialog covers the whole screen and the user would be inclined to think they are on a separate web page.
Look to the following links:
Prevent Browser Back Button for Silverlight with Confirm Dialog.
Silverlight - Prevent users from losing changes by using the browser back button
Managing Silverlight 3 navigation
behavior

Losing ASP.Net Session in popup window from Windows Forms Web Browser Control

I'm using Web Browser Control in a windows form (vb.net) to display one of our website (ASP.NET) as a part of the windows application. Everything works fine, but when I've a popup window from the website page, I'm loosing the ASP.Net session. I've used extended version of web browser control to have Navigate2 event to catch the popup window and open it in a windows form web browser control again, then it works, but I have problems with size of the popup and close button in the html popup window.
Please let me know if there is a work around for loosing session in Web browser control popup window in asp.net.
How can I open a popup window from my winforms web browser control without loosing the session?

Resources