Force parent window of iFrame into Compatability mode without access? - facebook

Facebook is having allot of JavaScript issues at the moment in Internet Explorer (IE 9), however by clicking the IE 8 Compatibility Mode button, or by switching to IE 8 Compatibility via the Developer tools you can get rid of all the JavaScript errors.
My apps are using the newer iFrame method, I have tried the following tags:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<meta http-equiv="X-UA-Compatible" content="IE=IE8" />
Neither seemed to switch the parent frame into the correct mode (document.documentMode != 8), is there a way to force IE 9 into Compatibility mode for the whole site (facebook.com) from within a iFrame either via JavaScript or some undocumented method?

Not unless you have control of the site.

You can have a look at compatilbility-view
In a web application where I had access to the server, I added a custom HTTPHeader entry for the target web site:
Custom Header name: X-UA-Compatible
Custom Header value: IE=EmulateIE7
In order to force IE8 to behave like IE7, and it worked well.

Related

Debugging on a mobile device?

i have a mobile website i am converting from a desktop site but have some unwanted white space that i cannot seem to remove. Its either padding or margin somewhere but i cant track it down.
Is there a way to the same as firefox's inspect and see exactly what styles affect what?
The site is being made via media queries and i cannot find any emulators that work with this.
Thanks.
Using this meta view port should be the correct width for iphones right?
<meta name="viewport" content="user-scalable=no,width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
Do you want to see your website source?
if you use Google Chrome you can add view-source: before any URL that you want to see it's source.
For example:
http://www.google.com shows you Google website and view-source:http://www.google.com shows you Google website source.
Note: maybe it work on other browser but I didn't test it.

Disadvantage of redirecting to error page on javascript disabled

I searched on the web and I didn't find any website using this technique. When javascript is disabled or doesn't supported by the browser, all those website are showing small boxes of error above their main content while no one is using redirecting to error page technique. I am using following code in my site to do this
<noscript>
Javascript is disabled.
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.wrangle.in/jserror.aspx">
</noscript>
But as my research resulted in less usage of this feature on www, so I want to know is there any disadvantage of this technique due to which these websites are not using this?

Links in fb canvas apps not working in IE

I created a canvas facebook app. The app itself was made in html and consisted of multiple different pages, the first page linking to the next, and so on... (links were assembled as simple html a tags with target="_self")
Everything seemed to be working fine in FF, Safari, Chrome, but not when we were testing in IE. It seems that redirecting within an iframe works different in IE, and it showed in the url of the browser:
When testing in FF,..., the url of the startpage would be apps.facebook.com/our-namespace, and after linking to the next page, this url in the browser would always remain that same apps.facebook.com/our-namespace.
When testing in IE, the url of the startpage would also be apps.facebook.com/our-namespace, but as soon as you hit one of the links, the url in the browser would change to apps.facebook.com/our-namespage/the-page-we-re-linking-to.php, not taking the target="_self" into account. When clicking on a comparable link again, the app would redirect to the start screen...
I spent hours trying to find an answer, I saw that changin IE's security settings would make it work:
in IE: go to Tools --> Internet Options --> Security --> Internet Zone --> Custom Level --> Miscellaneous --> Launch programs and files in an IFRAME. and make sure it is set to enabled
But this is not an acceptable solution as IE is configure different by default.
I found the solution was (in php) to add the following line to your code:
<?
header("p3p: CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV\"");
?>
Problem solved! This should be in the facebook developer docs!!

Facebook application (Static HTML)

I'm trying to create a landing page on facebook with the Static HTML application, but the image does not appear in IE8 show only at 9 and other browsers like Chrome and Firefox.
The application link is: https://www.facebook.com/hyundainic/app_128953167177144.
Yet another application that looks like:
https://www.facebook.com/SomosEskimo/app_367456286664440.
This if displayed in all browsers, except that technically I do not know if it's the same.
I'm editing the html / css and occupy absolute and relative positioning, I thought that this could affect and remove it, but the problem persists forever.
Can someone help me with this?
I think the issue is probably that you are using an absolute, non-SSL URL for the image source, and the links you posted to the app use SSL. If you leave the protocol off (example: "//whatever.com/myimage.jpg" instead of "http://whatever" or "https://whatever") the browser will use https when needed.
However, it looks like your image doesn't work over SSL:
https://hyundai.com.ni/img/quickservice-fb.jpg?id=3
You can try viewing your app using http:// and confirm it displays ok in all targeted browsers to see if this is really your issue.

iPhone Web App - Session & Current url lost when call answered

I have a multi-page website that is designed to work as a web-app on an iPhone.
It has the usual:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="apple-touch-startup-image" href="/images/startup.png" />
The site doesn't use Sencha or Javascript to navigate between pages, just standard anchor links, and page-reloads (I'm aware that the standard approach to web-apps is to use a Sencha-like interface).
It works perfectly fine when launched from the iPhone homescreen, and works the same as when viewed through Safari.
An issue seems to arise, though, when a phone call is answered mid-session.
Once the call is complete, the iPhone (version 4 in this case) reverts back to the web-app, but instead of restoring the previously-viewed page it reloads the homescreen (the same page that is loaded when the web-app is initiated)
When viewing the site in Safari, and accepting a call, it doesn't do this and maintains the url and current session values.
Is this a known issue in web-apps? Is there a workaround?
(one idea I have is to maintain the session and url values in a local SQLite database, but I'm not sure if this is the best approach)
The trick is to do this:
// Start or resume session
session_start();
// Extend cookie life time by an amount of your liking
$cookieLifetime = 365 * 24 * 60 * 60; // A year in seconds
setcookie(session_name(),session_id(),time()+$cookieLifetime);
I tested this to work on iOS 4.2.1, 5.1.1, 6.0 and 6.1. The session is even restored after turning off and restarting the device.
For a more elaborate discussion of this strategy you can take a look at my answer of this question:
Maintain PHP Session in web app on iPhone
Instead of storing the login info in a $_SESSION variable, store it in a $_COOKIE. The cookie will be saved depending on when you set it to expire. As long as they log in "inside" the web app, or the regular web version (and the cookie is the same) they will not have to log in every time or when switching between the two.
I haved the same problem with my WebApp under iOS v10. It was not a problem of session and / or cookie (session mecanism was OK, based on a cookie with suffisant lifetime).
The problem is when running in WebApp mode (i.e. application launch from a desktop shortcut, not whithin Safari), the "context" is lost when switching to another app (for example answer a call). When you come back to the app, the requested URL is not the last one, but it is the URL saved into the desktop shortcut...
In my case, the shortcut was made from the login screen , so every time I switched back to my app from another app, it was the /login URL called... It looks like I was logged out...
So be careful of the URL shortcut on your web app.
At this point, I have not found a way to specify a specific URL when the user create the shortcut.