Jump to content

Remove <frame> eliment from page


darklexus2k9

Recommended Posts

Hi all i am creating a chrome extenshion and i have it all working good but there is one problem

 

the code i had to try remove a <frame> eliment was wrong

 

can some one help me remove the <frame> eliment ?

 

there are 3 of them in the page

 

but the one i want to remove is : <frame src="view.php" name="view">

 

does anyone know the code i would need to remove this <frame> from this page or even jus change its url to about:blank

 

i really need help with this i have been searching google and all the code i try does not work :/ i am not the best with javascript

Link to comment
https://forums.phpfreaks.com/topic/267756-remove-eliment-from-page/
Share on other sites

This should work, but untested.

 

if (window.document.getElementsByTagName("frame") != undefined)
{
var tag = window.document.getElementsByTagName("frame");

for (var x in tag)
{
	if (tag[x].name != undefined)
	{
		if (tag[x].name == "view")
			tag[x].parentNode.removeChild(tag[x]);
	}
}
}

darklexus2k9: The first step of getting help with your code, is to actually post your code. Second step is to explain, in a clear and concise manner:

1) What you want to do.

2) What you expected the code to do.

3) What it actually did.

 

Preferably with actual examples as well, so that we can see the flow of logic for each step.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.