Viewing and logging blocked items

General discussion about the NoScript extension for Firefox
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: Viewing and logging blocked items

Post by dhouwn »

If we are at it, it could be also written as:

Code: Select all

const LOG_CONTENT_BLOCK = 1;
const LOG_CONTENT_CALL = 1 << 1;
const LOG_CONTENT_INTERCEPT = 1 << 2;
const LOG_CHROME_WIN = 1 << 3;
etc.

Looks nicer, IMHO.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4) Gecko/20100818 Firefox/4.0b4
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3365
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Thank you Giorgio, I appreciate that. So if you use a value say (8192) it logs EVERYTHING. But if say you use (32) it will log everything from the beginning to that point and not the rest, right? We don't have to actually add the values or increment do we? Just making sure, since I see you are using Constants in a sort of enum, wanted to make sure they are not individual but rather inclusive.
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Viewing and logging blocked items

Post by therube »

> const LOG_CONTENT_CALL = 1 << 1;

But not everyone will understand the meaning of that notation.
(I don't, but gather it is a bitwise manipulation.)

> So if you use a value say (8192) it logs EVERYTHING
> But if say you use (32) it will log everything from the beginning to that point and not the rest, right?

No & no.
8192 will only log ABE & 32 will only log Injection.

> We don't have to actually add the values or increment do we?

Yes.
1 + 2 + 4 + 8 (so a total of 15; noscript.consoleDump=15) will give you the first 4 items (block, call, intercept, chrome)
1 + 4 (so a total of 5; noscript.consoleDump=5) will give you (only) block & intercept

Bit field

Bit manipulation

A Quick Bitmask HOWTO for Programmers
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; rv:2.0b5pre) Gecko/20100823 AMAZON FIX YOUR UA NOT Firefox/3.0 SeaMonkey/2.1b1pre
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3365
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

@therube, thank you for that. I guess I wasn't clear, I am familiar with how bitwise calculations are done, I just wanted to make sure whether he is using the traditional which will have to be stacked as you put it so well, or its all inclusive to lessen the chance of mistakes by less familiar users. That's the clarification I was going for, otherwise, I am familiar with the standards of bitmask/bit manipulations, thank you :D Its always good to see you doing your thing though, its awesome, good job and keep it up. 8-)
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3365
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Giorgio, have you noticed the MASSIVE amount of CPU consumption and a major performance degradation when you enable ANY of these logging items? Especially if you stack them to include say all of them. I noticed that even with ONE of them it consumes quiet a bit of resources and slows WAY down but anything more than that and it becomes nearly unusable. Just saying to see if you know the exact performance cost of this or have it benchmarked?
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
tlu
Senior Member
Posts: 129
Joined: Fri Jun 05, 2009 8:01 pm

Re: Viewing and logging blocked items

Post by tlu »

This is a highly interesting and informative thread, indeed!

And this is an opportunity to point out that jimoe's problem is probably common to particularly (but not only) Noscript newbies. I guess for many NS users it's hard to tell what exactly is responsible if something doesn't work as expected: blocked scripts, blocked plugins, HTTPS settings, XSS or ABE rules. Okay, we have the Firefox error console, and we can start FF with -Console option as we learnt in this thread.

But let's face it: For most users this is much too complicated and user-unfriendly, and I think this is one major reason why many users give up with Noscript. A logging function available from the NS menu which clearly indicates what exactly NS is blocking is therefore highly desirable. I realize that this would surely blow up the NS code, and it might also increase CPU consumption as GµårÐïåñ suggests. I have no idea if Giorgio can solve this problem - perhaps this logging function should only be enabled on request. But I'm sure that for many users this would make life a lot easier, and it would surely improve the acceptance of Noscript in general.

Giorgio, what do you think about this?
Mozilla/5.0 (X11; U; Linux x86_64; de-DE; rv:1.9.2.10pre) Gecko/20100904 Ubuntu/10.04 (lucid) Namoroka/3.6.10pre
parch
Posts: 2
Joined: Wed Jun 22, 2011 3:22 pm

Re: Viewing and logging blocked items

Post by parch »

Hi folks,

I've recently noticed NoScript logging (a lot) to the console where it didn't before. I'm using 2.1.1.2rc5 with Firefox 4.0.1 on Arch Linux.

about:config shows

Code: Select all

noscript.consoleDump     0
noscript.consoleLog     false
Changing noscript.consoleLog to true reduces the output to one entry per page visited, such as

Code: Select all

[NoScript] http://forums.informaction.com/index.php, false, false(text/html), true, true, true
Is there any way to de-activate all output?

Many thanks.
Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Viewing and logging blocked items

Post by Giorgio Maone »

Please get rc6 from http://noscript.net/getit#devel or switch back to stable 2.1.1.1
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
parch
Posts: 2
Joined: Wed Jun 22, 2011 3:22 pm

Re: Viewing and logging blocked items

Post by parch »

Giorgio Maone wrote:Please get rc6 from http://noscript.net/getit#devel or switch back to stable 2.1.1.1
Wow, that was a quick reply! Many thanks for all your hard work.

EDIT: Yes, rc6 is silent :)
Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3365
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Yes we monitor and Giorgio is a master at being on top of it. As for the suggestion to add some type of logging on demand for support purposes is something that I would support. Although the UI-less implementation (as in right now) is sufficient for most cases, but a possible support tab with the option to select the level of logging and even possibly a location to store it like a text file on the desktop or something so it can be attached is something that I think is worth looking into to reduce the amount of back and forth in getting the information needed to debug an issue. Thank you for your input.
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/6.9 (en-US; rv:6.9.6.9) Gecko/66666666 Firefox/6.6.6
Post Reply