For better PayPal support, framework based way to detect what page is displaying, so embedded can choose to resize the window.
steiger opened this issue · comments
The issue is that the store style may designed to look great for a narrower window such as 500px. However if the customer pays with PayPal and is taken offsite, PayPal’s process may look better with a wider window.
So it would be handy if the framework provided a way, by looking at the URL, to notify the app when it was navigating away from sites.fastspring.com, so that they could opt to resize the window on that event.
From client:
My code for widening/narrowing the window is dead simple — when the browser control loads a page I look at the loaded URL and resize the window based on whether the host is PayPal or not.
What would be nice is if the FS Framework had an event/delegate method that told my app whether or not it’s displaying a page with my store style or not. I know my store style is 550px wide and PayPal is “bigger”, so I can size the window appropriately based on that information alone.
I tried to dynamically resize the window by determining programmatically the width of the rendered page. Unfortunately, the .NET WebBrowser control and the MSHTML library seemed to have no reliable way of getting the minimum page width before you get horizontal scrollbars. I didn’t even try with the WebKit one on Mac OS X!
Enhanced Controller.DidLoadStore and added Controller.DidLoadPage.