Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #90249

OT: Controlling webpages in Firefox

From "Mayayana" <mayayana@invalid.nospam>
Newsgroups alt.comp.os.windows-10, alt.windows7.general, microsoft.public.windowsxp.general
Subject OT: Controlling webpages in Firefox
Date 2019-05-07 10:32 -0400
Organization A noiseless patient Spider
Message-ID <qas51d$vod$1@dont-email.me> (permalink)

Cross-posted to 3 groups.

Show all headers | View raw


Using the userContent.css file in FF to change webpage display.
------------------------------------------------------------

  There was a brief discussion about page rendering in the FF
thread but I thought this separate post might be useful to some.

  Many people have trouble with pages not displaying correctly
or with obnoxious popovers. The former is especially a problem
for people disabling script. The second is one of the problems
that comes with enabling script.

  In FF, any webpage element can be edited using userContent.css
in the app data folder. You can override all links, for instance, and
make them purple if you want to. Where this really comes in handy
is that CSS can be applied based on class or ID. Class and ID are
are functionally the same. They identify elements in a webpage.

Class is denoted in CSS with a period and ID with a hash sign:

.TopMenu
#TopMenu

One can find those details by right-clicking the element in Firefox,
then clicking "Inspect Element" on the context menu. A view of
the HTML will open with the code for that element highlighted.
(Assuming you have the Web Tools installed with FF.)

Examples of usage:

Many pages use an overlay to force enabling script. It's often
of class "overlay". So to make it disappear:

.overlay {display: none !important;}

   Bostonglobe.com recently started showing a left-side slide-out
menu that's broken without script, covering half the page. So I
checked out the code and came up with this to make it disappear:

.secondary-nav-screen-container {display: none !important;}
.secondary-nav-options-container {display: none !important;}
.navigation-sidebar {display: none !important;}

The first two lines are for Boston Globe. The 3rd is a generic entry
that works for many other sites.

  I have lots of these custom settings. It can sometimes be tedious
to find the right class or ID, but often one fix will work for many
pages. The way it works is that most webmasters don't entirely
know coding. They use libraries like jquery to simplify the job. Then
they trade snippets of code with other webmasters to get particular
functionality. No normal person would use a class name in CSS like
"secondary-nav-screen-container". Most would probably call it
something like "menu-left", "PopoutMenu", etc. They have those
ridiculously technical names because they're generic inventions that
get passed around, used by partially educated commercial webmasters
who are mainly working with WYSIWYG tools.

   The same problem of webmaster fads that breaks so many pages
also sometimes makes it possible to fix them en masse.

  Here's another one to stop motion/animation, slideshows, etc that's
still present after script is disabled:

* {transform: none !important;
-moz-transform: none !important;
transition-property: none !important;
-moz-transition-property: none !important;
-moz-transition-duration: none !important;
animation: none !important;
-moz-animation: none !important;
:before {display: none !important;}
:after {display: none !important;}

:before and :after are especially obnoxious. Kids use them
to do things like make the first letter in a sentence drip with
green slime. They allow any element to have styles specified
for just in front and just after that element. The lines above
block all uses of :before and :after.

Here's what I've used to remove Twitter quotes from virtually
all webpages:

#divRawLinkBackRow {display: none !important;}
#sharebar_fixed {display: none !important;}
#sharebar_fixed_social {display: none !important;}
.twitter-tweet {display: none !important;}

  Some people may like Twitter quotes. I find them intrusive.
They're virtually always trite and serve as a way for journalists
to not do their job. If an article isn't relevant without tweets
from pop stars or politicians then I probably don't want to be
spending my time reading it.

 This can also be used for whole elements:

EMBED {display: none !important;}
VIDEO {display: none !important;}
MARQUEE {display: none !important;}

(Marquee are those obnoxious scrolling animations that
scroll text.)

  Knowwledge of HTML and CSS is necessary to write these, but
many of them can also be found online, or offered as samples
by Mozilla.

Back to alt.comp.os.windows-10 | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

OT: Controlling webpages in Firefox "Mayayana" <mayayana@invalid.nospam> - 2019-05-07 10:32 -0400
  Re: OT: Controlling webpages in Firefox "J. P. Gilliver (John)" <G6JPG-255@255soft.uk> - 2019-05-07 16:04 +0100
    Re: OT: Controlling webpages in Firefox "Mayayana" <mayayana@invalid.nospam> - 2019-05-07 11:52 -0400
      Re: OT: Controlling webpages in Firefox "J. P. Gilliver (John)" <G6JPG-255@255soft.uk> - 2019-05-07 19:11 +0100
        Re: OT: Controlling webpages in Firefox "Mayayana" <mayayana@invalid.nospam> - 2019-05-07 15:03 -0400

csiph-web