Join 3,429 readers in helping fund MetaFilter (Hide)


I would like a simple frame blocker please.
November 29, 2011 9:01 AM   Subscribe

I'd like a CSS filter for Stylish (Chrome) that will block the first frame of a webpage.

The webpage source is something like:
Let's pretend the parentheses are angle brakets.

(frameset border="0" rows="92,*")

(frame name="HEAD" scrolling="no" src="http://www.whatever.com/HEADsoure.htm")

(frame name="BODY" src="http://www.whatever.com/BODYsource.htm")

(/frameset)

I've tried:
frame[name="HEAD"]{
    display: none;
  }

and

iframe[name="HEAD"]{
    display: none;
  }
but neither of these work, could someone give me a clue? Googling for stylish and tutorial doesn't exactly get me where I want to go.
posted by Brent Parker to Technology (13 answers total)
 
You could try "frame:first-child"
posted by wongcorgi at 9:09 AM on November 29, 2011


frame:first-child didn't work =(
posted by Brent Parker at 9:31 AM on November 29, 2011


I don't know about Stylish, but you might need a parent selector for first-child:

body frame:first-child, body iframe:first-child { display: none; }
posted by neckro23 at 9:51 AM on November 29, 2011


Its not frame first child it would be frameset:first-child I believe.

Have you tried making sure the selector is working (maybe throw a border around it)

I honestly have no idea if you can affect a frame with CSS.
posted by bitdamaged at 10:22 AM on November 29, 2011


Maybe a userscript solution is what I need then.
posted by Brent Parker at 11:05 AM on November 29, 2011


I don't know about Stylish, but have you tried adding !important to your attributes?

Also, Chrome's Inspector is really handy for figuring out CSS selectors, and for seeing when CSS you're trying to set is overridden.
posted by mkultra at 11:15 AM on November 29, 2011


I just tried making three html documents (one holding the frameset and two for the frames), and defining styles for frame or frameset, like display:none or visibility:hidden did nothing (same with added !important).

I think you need a userscript to do what you want to do.
posted by bjrn at 12:19 PM on November 29, 2011


I have it targeted and "invisible" with this, but I now I have a big blank box at the top of the page.

frame[name="HEAD"]
{
visibility:hidden;
}
posted by Brent Parker at 12:32 PM on November 29, 2011


I should have tested it in Chrome. I'm glad that worked, this should finish it up:

frame[name="HEAD"] { visibility:hidden; }
frameset { margin-top:-92px; }


Since the top frame is 92px high we bump up the whole frameset (because I couldn't get the head or main moved).
posted by bjrn at 12:50 PM on November 29, 2011


Heh, now that frame is at the bottom of the page - which is an improvement! Thanks for helping me figure some kind of solution out bjrn.
posted by Brent Parker at 1:27 PM on November 29, 2011


have you tried display:none instead of visibility:hidden to see if you can collapse the unwanted frame (remove it from the page flow entirely), rather than just hiding it?
posted by misterbrandt at 11:57 AM on November 30, 2011


yeah display:none is completely ignored for some reason.
posted by Brent Parker at 5:57 PM on November 30, 2011


oh right, like you said in your original post...

{display:none !important}

maybe?
posted by misterbrandt at 7:47 AM on December 1, 2011


« Older I made pumpkin puree last Wedn...   |  What is this? My google-fu is... Newer »
This thread is closed to new comments.