iframe only working with some sites in Safari - iframe

I have two iframe's below. One works in safari and one does not. I cannot seem to figure out why this is happening.
If the iframe will cause problems with soultion, can you recommend a solution for embedding a web page within a web page?
Thanks!!!
This works on Safari:
<html>
<head>
<title>iframe Test</title>
</head>
<body>
<iframe src="http://ebay.com" width="100%" height="400"></iframe>
</body>
</html>
This does not work on Safari
<html>
<head>
<title>iframe Test</title>
</head>
<body>
<iframe src="http://public.bullhornstaffing.com/JobBoard/Standard/default.cfm?privateLabelID=7327" width="100%" height="400"></iframe>
</body>
</html>

The URL you listed requires four cookies to be installed before loading the page. Safari doesn't load the cookies when accessed via an iframe. If you open the url directly in another tab - it loads fine and then refreshing the iframe tab loads the iframe without error. Delete the cookies and the iframe doesn't load again. The cookies in part direct a redirect.
This is a bug on the iframe target side of the equation. Its not loading the cookies into safari via the iframe. It loads fine in Chrome.

Related

iframe with local resource in Electron

I need to render iframe in my Electron application:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<iframe sandbox='allow-scripts' src='frm.html'></iframe>
</body>
</html>
where the frm.html links the local file script foo.js which is part of my Electron application
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<script src="foo.js"></script>
</head>
<body>
<p>Inside iframe</p>
</body>
</html>
When I run the application in Electron I can see this error in devtools console
Not allowed to load local resource: file:///C:/electron/app1/foo.js
Is it possible such scenario in Electron?
This is a security feature of the iframe. Here is a similar question that talks about loading linked files into an iframe: Displaying local htm file in iframe?.
That being said, have you considered using the webview tag instead? http://electron.atom.io/docs/v0.30.0/api/web-view-tag/. The webview tag is very similar to an iframe, but gives you more ability to control the security around it. I tested loading a local file into a webview in the same way you attempt to load frm.html into the iframe and it works flawlessly.

IE11 will not load external css from intranet

IE11 will NOT load external css from the intranet - at all. Internal css works fine. In-line css works fine. External CSS works fine on the Internet. Everything works fine in other browsers - everywhere!
When I open C:\Users\hennesse\Desktop\test.html (below) by either right-clicking and openWith->IE - or- typing into the IE location bar, I get two alerts: "internal javascript", and "external javascript" - then:
the first line is NOT red
the second line is blue
the third line is green
However, if I upload this to my web server, and open it with IE, the first line IS red. With Firefox and Chrome, the first line is ALWAYS red, intranet or internet.
For some reason, IE11 will not load the external CSS file on "My Computer".
Changing security settings in Internet Options->Security->Allow Active Content to run in My Computer (and rebooting) results in a prompt (or not) about Allow Active Content? But the results are the same.
This is driving me insane! -Dave
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="test.css">
<!--
external file test.css contains:
body { color: #ff0000 }
-->
<style type="text/css">
.blue {
color: blue;
}
</style>
<script type="text/javascript">
alert("internal javascript");
</script>
<script type="text/javascript" src="test.js">
// external file test.js contains
// alert("external javascript");
</script>
</head>
<body>
This should be red, but it isn't
<p class="blue">
This is blue
</p>
<p style="color:green">
This is green
</p>
</body>
</html>
In the F12 console, I found: SEC7113 "CSS was ignored due to mime type mismatch". Discussion here: 1 [MSDN]. It seems that IE9 and above "sniff" the HTTP headers for the correct MIME type, and ignore JS and CSS that have the wrong header. When it fetches files from the local filesystem, it should disable this sniffing, since there aren't any real HTTP headers.
But my particular computer is sniffing and ignoring anyway. I've searched and searched, but the mighty Internet has only yielded one other person who has this problem. She solved it by reloading the operating system. I'm not gonna do that!
I very seldom use IE for anything except a final compatibility check after I've loaded stuff to a server. Except for one personal "extension" to a Windows app that invokes IE on the user's computer. Since I'm the only using it, I just hit F12, and select IE8 mode (this shows it's the IE9-up MIME sniffing). It works fine, and since it only costs me a couple mouse clicks, it sure beats reloading the OS.
Although I didn't really solve the problem, perhaps the "sniff and ignore" info can help someone else do so. OCHI - thanks for your help.
-Dave

IFrame Won't retain CSS Style

I have a third party application that can host HTML in something it calls a container. In the container, we do the following:
<meta content="IE=EmulateIE9" http-equiv="X-UA-Compatible" />
<iframe style="WIDTH: 100%; HEIGHT: 640px" id="c_list"
src="/Path/ToMVC/ControllerPage" width="100%"></iframe>
In the _layout.cshtml that is used by ControllerPage, we hardcoded the links to the CSS in the head element. If I right click and pick "View Source", I can see the paths. Ex:
<link href="/Project/Content/Sheet.css" rel="stylesheet"/>
Despite all of the above, the CSS in Sheet.css is ignored/dropped/not used. When I view the "/Path/ToMVC/ControllerPage" URL in its own window, all the CSS renders without issue. How can I force the IFrame to stop dropping the CSS?
EDIT: Ok, I made a discovery. Using the F12 dev tools, I noticed the page using the IFrame was running in IE quirks mode instead of IE standards mode (Which is what the page is using when viewed outside of an IFrame). When I changed it to IE 9 Standards mode, all the CSS worked! Is there a way I can force the IFrame page to go with IE9 Standards instead of Quirks mode?

How to detect if JavaScript is disabled using Meteor.com

When using Meteor.com anyone know how to detect if the browser's JavaScript is disabled...
AND show a message to the end user in the browser window, i.e "Turn on JavaScript."
I assume that you have a layout.html or at least a main.html that contains at least a <head>.
A trick is to place <noscript> in the <head> instead of the <body>.
Meteor does not render everything in JS. There are some stuff that get's rendered in an initial page, proof of which can be seen in View Source (CTRL+U).
I'm using the latest Meteor in Chrome, and head tags were not merged. Only this worked for me:
<head>
<noscript>Please enable JavaScript.</noscript>
</head>
<template name="index">
...
</template>
I just used this and it really worked like a charm
<head>
<noscript>
<style>
body {font-size: 32px;text-align: center;line-height: 100vh;}
body:after {content: "Please enable JavaScript";}
</style>
</noscript>
</head>

How force iFrame open all links stay in the iFrame?

I'm hosting an iFrame and it seems like when a link points to external domains it loads it on the main window and not in the iFrame.
Is there a way to force the links to be opened in the same iFrame?
Notice: I can add anything I want to the page loaded in the iFrame (using Chrome extension).
I tried adding:
<base target="_parent" />
But it didn't do any good...
Check Headers of your external domain page. If X-Frame-Options Header is set to DENY, browser ignores loading content to iframe or frame set and loads in main frame of browser.
Regardless of the site attempts the page cannot be displayed in a frame.
Your Code
<base target="_parent" /> is used for Loading the result into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self, so it can not solve your problem
Use
<base target="myframe"> instead where myframe is name of your iframe.
<iframe width="200" height="200" name="myframe"></iframe>
Demonstration
Look for server headers for loading pages
<html>
<head>
<base target="myframe">
</head>
<body>
Base
A Tag
<iframe width="200" height="200" name="myframe"></iframe>
</body>
</html>
References
X-Frame-Options Header

Resources