Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.