Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hidden style sheet

22 views
Skip to first unread message

baldo

unread,
Jun 9, 2013, 1:59:13 AM6/9/13
to
Is it possible to hide a style sheet for all browsers?

dorayme

unread,
Jun 9, 2013, 3:10:57 AM6/9/13
to
In article <XnsA1DA514376E...@91.208.207.40>,
baldo <n...@novalid.no> wrote:

> Is it possible to hide a style sheet for all browsers?

You cannot actually hide other people's stylesheets whether they be
the default one the browser uses or one made and used by the browser
user (called a user stylesheet) but you can supply your own so as to
take your best shot to override what you expect would happen without
your intervention.

For example, to take just one case, the BODY element almost invariably
gets a margin, but you can, and it is actually quite common for
authors to, set it to 0.

(I believe Broweroginsts once tried to sneak html {display: none;}
into other people's websites but they failed. They contented
themselves with adding this to their own websites so that no one would
normally see anything at all. Unfortunately browser makers gave users
simple menu items to disable author stylesheets and everyone was able
to see their sites. They were rounded up and hanged I believe).

--
dorayme

Jukka K. Korpela

unread,
Jun 9, 2013, 5:07:30 AM6/9/13
to
2013-06-09 8:59, baldo wrote:

> Is it possible to hide a style sheet for all browsers?

Certainly. For example, write the style sheet only on a sheet of paper
and never show that paper to any browser. Well, better burn the paper to
be sure!

If you wanted to ask how to include a style sheet on your web page and
not include it there, then even God cannot do that. This is not a
limitation of God's power; it follows from the fact that a logically
self-contradictory description of a state of affairs does not describe
any state of affairs.

So how about telling us what you would really want to achieve?

--
Yucca, http://www.cs.tut.fi/~jkorpela/

dorayme

unread,
Jun 9, 2013, 5:27:27 AM6/9/13
to
In article <dorayme-94AAA1...@news.albasani.net>,
dorayme <dor...@optusnet.com.au> wrote:

> Broweroginsts

That should read "Browseroginists".

--
dorayme

baldo

unread,
Jun 9, 2013, 7:38:19 AM6/9/13
to
"Jukka K. Korpela" <jkor...@cs.tut.fi> wrote in news:kp1gbp$2tv$1@dont-
email.me:

>
> So how about telling us what you would really want to achieve?
>

I like to hide my extern linked style sheet to protect some codes...

Jukka K. Korpela

unread,
Jun 9, 2013, 7:49:02 AM6/9/13
to
2013-06-09 14:38, baldo wrote:

> I like to hide my extern linked style sheet to protect some codes...

So this is a variant of "how do I hide my web page code". The answer is
twofold. First, you cannot. Anything that a browser can read can be read
by a human being, too, and it's not even difficult to anyone who would
know what to do with the code. Second, if you want to protect your code
from being "stolen", the odds are that even a drunken monkey wouldn't
dream of "stealing" it.

It is true that some authors are more stupid than drunken monkeys, but
then it's really their problem if they "steal" your code. You can damage
them a bit more by including misleading or plain wrong comments into
your CSS code. (You won't need to try hard. Usually when people write
any comments in CSS code, they are misleading or wrong, or become
misleading or wrong when the code is edited and the comments will be
retained as such.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Luuk

unread,
Jun 9, 2013, 2:39:54 PM6/9/13
to
On 09-06-2013 11:07, Jukka K. Korpela wrote:
> If you wanted to ask how to include a style sheet on your web page and
> not include it there, then even God cannot do that. This is not a
> limitation of God's power; it follows from the fact that a logically
> self-contradictory description of a state of affairs does not describe
> any state of affairs.

A real believer will claim its not logical to claim this as a limitation
of Gods' power.

Because you should know that there is NO limit to God's power, and
therefore He can do so, even if it follows from the fact that a

j

unread,
Jun 11, 2013, 9:32:14 AM6/11/13
to
On 6/9/2013 1:59 AM, baldo wrote:
> Is it possible to hide a style sheet for all browsers?

It's much easier to make them undecipherable, in fact most come that way.

It is sort of possible to make a server generated stylesheet (with the
correct Content-type) that would be hard to access as a link, but the
stylesheet contents would still be visible in any of the web developer
tools that the browser might have.

Otherwise, I agree completely with Jukka.

Jeff

>

Gordon Levi

unread,
Jun 12, 2013, 5:08:52 AM6/12/13
to
baldo <n...@novalid.no> wrote:

>Is it possible to hide a style sheet for all browsers?

The usual response to this and to hiding the source of a web page is
that it can't be done. That may be true but I think you could
obfuscate it
<http://en.wikipedia.org/wiki/Obfuscation_%28software%29>. That would
protect your source from all but the most determined snoopers unless
they could use it unaltered.

Jonathan N. Little

unread,
Jun 12, 2013, 8:18:36 AM6/12/13
to
First Law of Web Development:

The intrinsic value of code is inversely proportional to the effort to
hide it.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Gus Richter

unread,
Jun 14, 2013, 12:06:17 AM6/14/13
to
On 6/9/2013 1:59 AM, baldo wrote:
> Is it possible to hide a style sheet for all browsers?


You mean something like this?

<http://tinyurl.com/kep3z79>

--
Gus


Jonathan N. Little

unread,
Jun 14, 2013, 12:14:10 AM6/14/13
to
Obfuscated, but not hidden:

/* Hidden in plain sight */
article {
margin:auto;
font-size:100%;
width:50%;
background-color:#FFFF99;
color: red;
margin-top:10em;
padding: 0 .5em;
border:1px dashed #f00;
}

p {
text-align:center;
font-size:110%;
}
em {
color:blue;
}
#interrobang
{
Font-size:200%;

Gus Richter

unread,
Jun 14, 2013, 4:42:51 PM6/14/13
to
On 6/14/2013 12:14 AM, Jonathan N. Little wrote:
> Gus Richter wrote:
>> On 6/9/2013 1:59 AM, baldo wrote:
>>> Is it possible to hide a style sheet for all browsers?
>>
>>
>> You mean something like this?
>>
>> <http://tinyurl.com/kep3z79>
>>
> Obfuscated, but not hidden:

Many years ago this same question arose in Blooberry's chat which is no
longer there. In fact the Blooberry site itself is no longer maintained.
In any case, I submitted a similar page as a lark back then. It turned
out, to my surprise, that everyone was very confused and asked how I did
it (without the many tools available today, there was only Notepad back
then).

I now submitted this in the same spirit. I wonder if anyone nowadays
finds this initially surprising and confusing.

--
Gus


Jonathan N. Little

unread,
Jun 14, 2013, 5:53:30 PM6/14/13
to
No special tools required. View source has always been there that I
recall since the first Netscape Navigator...I don't know about Mosaic, I
never used it.

Gus Richter

unread,
Jun 14, 2013, 9:33:51 PM6/14/13
to
On 6/14/2013 5:53 PM, Jonathan N. Little wrote:
> Gus Richter wrote:
>> On 6/14/2013 12:14 AM, Jonathan N. Little wrote:
>>> Gus Richter wrote:
>>>> On 6/9/2013 1:59 AM, baldo wrote:
>>>>> Is it possible to hide a style sheet for all browsers?
>>>>
>>>>
>>>> You mean something like this?
>>>>
>>>> <http://tinyurl.com/kep3z79>
>>>>
>>> Obfuscated, but not hidden:
>>
>> Many years ago this same question arose in Blooberry's chat which is no
>> longer there. In fact the Blooberry site itself is no longer maintained.
>> In any case, I submitted a similar page as a lark back then. It turned
>> out, to my surprise, that everyone was very confused and asked how I did
>> it (without the many tools available today, there was only Notepad back
>> then).
>>
>> I now submitted this in the same spirit. I wonder if anyone nowadays
>> finds this initially surprising and confusing.
>>
>
> No special tools required. View source has always been there that I
> recall since the first Netscape Navigator...I don't know about Mosaic, I
> never used it.

Right on. The straightforward way. But you see, many/most people
will/did not think of the scrolling part.

I was thinking more in terms of today's developer tools (e.g. Firebug)
which is overkill in this instance.

--
Gus


dorayme

unread,
Jun 14, 2013, 9:37:43 PM6/14/13
to
In article <kpe51f$dbe$1...@dont-email.me>,
"Jonathan N. Little" <lws...@gmail.com> wrote:

> Gus Richter wrote:
> > On 6/9/2013 1:59 AM, baldo wrote:
> >> Is it possible to hide a style sheet for all browsers?
> >
> >
> > You mean something like this?
> >
> > <http://tinyurl.com/kep3z79>
> >
>
> Obfuscated, but not hidden:
>
> /* Hidden in plain sight */
> article {
> margin:auto;
> font-size:100%;
> width:50%;
> background-color:#FFFF99;
> color: red;
> margin-top:10em;
> padding: 0 .5em;
> border:1px dashed #f00;
> }
>
> p {
> text-align:center;
> font-size:110%;
> }
> em {
> color:blue;
> }
> #interrobang
> {
> Font-size:200%;
> }

It's actually more complicated due to browser differences. On my
Safari, both yours and Richter's just shows up in View source. In
Firefox, Richter's does not but yours does.

--
dorayme

Jonathan N. Little

unread,
Jun 14, 2013, 10:38:30 PM6/14/13
to
No, it all there in all browser, you have to scroll because he put
leading whitespace....it's like the folks that try to hide source with
50 or so leading carriage returns.

Beauregard T. Shagnasty

unread,
Jun 14, 2013, 10:54:13 PM6/14/13
to
Jonathan N. Little wrote:

> No, it all there in all browser, you have to scroll because he put
> leading whitespace....it's like the folks that try to hide source with
> 50 or so leading carriage returns.

There appears to be about 250 leading spaces in Gus's lines. When I view
source in his page with Firefox, the CSS wraps, so there is no hiding at
all. I didn't even notice the excess spacing the first time I looked, as
the CSS was right there in front of me...

--
-bts
-This space for rent, but the price is high

Gus Richter

unread,
Jun 15, 2013, 12:37:15 AM6/15/13
to
On 6/14/2013 10:54 PM, Beauregard T. Shagnasty wrote:
> Jonathan N. Little wrote:
>
>> No, it all there in all browser, you have to scroll because he put
>> leading whitespace....it's like the folks that try to hide source with
>> 50 or so leading carriage returns.
>
> There appears to be about 250 leading spaces in Gus's lines. When I view
> source in his page with Firefox, the CSS wraps, so there is no hiding at
> all. I didn't even notice the excess spacing the first time I looked, as
> the CSS was right there in front of me...

Yup, browsers act differently I see. It didn't used to a bunch of years
ago. For some of them it seems to depend on the View Source Width. For
me Firefox renders as it did in the old days; nicely tucked off to the
right accessible by scrolling. In any case, this was not meant as a
serious thing, only in fun.

--
Gus


dorayme

unread,
Jun 15, 2013, 3:51:55 AM6/15/13
to
In article <kpgjq0$lk4$1...@dont-email.me>,
"Jonathan N. Little" <lws...@gmail.com> wrote:

> dorayme wrote:
> > In article <kpe51f$dbe$1...@dont-email.me>,
> > "Jonathan N. Little" <lws...@gmail.com> wrote:
...
> > It's actually more complicated due to browser differences. On my
> > Safari, both yours and Richter's just shows up in View source. In
> > Firefox, Richter's does not but yours does.
> >
>
> No,

Yes, OK, but in my Safari, *no horiz scrolling is needed*, the browser
sees through it and brings it all to the left and it is visible from
the get go.

--
dorayme
0 new messages