nyongrand
nyongrand

Reputation: 618

how to add element of page to another page with greasemonkey

ok, i try to add black google bar to top of facebook page, so this my attemp using jquery

// ==UserScript==
// @name           GooggleBar Facebook
// @namespace      nyongrand
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// @include        http://www.facebook.com/*
// ==/UserScript==

$('<div id="result">a</div>').load('http://www.google.com/index.html #gbg').insertBefore('#blueBarHolder');

but its not working, so i try to use iframe

// ==UserScript==
// @name           GooggleBar Facebook
// @namespace      nyongrand
// @include        http://www.facebook.com/*
// ==/UserScript==
var getRef = document.getElementById("blueBarHolder");
var makeIframe = document.createElement("iframe");
makeIframe.setAttribute("height", "150px");
makeIframe.setAttribute("src", "http://google.com");
var parentDiv = getRef.parentNode;
parentDiv.insertBefore(makeIframe, getRef);

with this iframe was created but no content in the iframe, iframe is blank altought i see

<iframe width="325px" height="150px" src="http://google.com">

in firebug.

Upvotes: 1

Views: 1213

Answers (1)

XepterX
XepterX

Reputation: 1011

it's blank because the display is forbidden in the X-Frame-Options. you can read more about this in Overcoming display forbidden by X-Frame-Options

Upvotes: 3

Related Questions