Sunday, 6. July 2008, 00:59:59
BlockIt, the User Javascript answer to NoScript
This is a userjs that almost mimics NoScript, but does one better!NoScript is a firefox extension that allows selective blocking and unblocking of external scripts on the page which is its basics.
But when compared to my script, mine allows selective blocking and unblocking of Images, Iframes, and Embedded content on the page!
There is documentation of my script available here , which is probably better explained than here.
Enjoy
BlockIt.js
Some of you might notice that this is similar to a previous script I made, it is, it was called "Ultimate Blockage", but I've renamed it and reversed the blocking/unblocking process too, and now the old version of it lies hidden deep within the depths of this thread.
Sunday, 6. July 2008, 09:45:26 (edited)
Is there a way to remove the imageblocking? Its kinda anoying on some sites (tested on facebook). I't could maybe be done by making it like modules? Well, i hope you could change/edit that. I rather use the build-in blocker in Opera for that.
*edit* Tried the script ofr some time now, its rocking!
Sunday, 6. July 2008, 23:59:43
Changelog: Fixed a bug where the the UI won't show properly if no scripts are in the page.
Added "imgblockIt","mediablockIt" and "iframeblockIt" variables to the script, allows blocking of images, media or iframes to be turned off altogether respectively.
Monday, 7. July 2008, 22:46:25
Changelog:
Speeded up blocking of elements in the page a bit. So images should disappear quicker.
Added detection so the script doesn't run on images or text files.
Removed some redundant code.
Tidied up a bit of the CSS in the file, overall the file should be a bit smaller now.
Tuesday, 8. July 2008, 13:31:38
On this page, "button" created by BlockIt.js looks not very much correctly.
Tuesday, 8. July 2008, 22:23:21 (edited)
Wednesday, 9. July 2008, 00:48:58
Changelog:
A little further tweaking so elements are blocked a little faster.
Now the UserInterface has a more prominent style, which fixes the styling problem on Lex1's page.
New feature, if Alt key is held while clicking on either "block/unblock", "all", or "server" settings aren't written to cookie, that is so you can view an element in the page quickly without the sometimes needless cookies.
Wednesday, 9. July 2008, 14:21:23 (edited)
edit:
I'm sorry, but after using this for several hours I have to admit - again - that I am obviously too stupid a user to use this. Even with the help page you have provided. I don't know who wrote it or made it, but even after reading it three times over I don't get it.
Could you enable tooltips with useful information for the popup buttons? I keep having to look up which meta key does what.
Or could you restructure that popup gui so it is more intuitive?
Give people an option so they can hide/disable stuff that is on the same server as well, selectively (the second number in the "(3,7)" indicator?
And generally be clear about what will happen when I click Unblock, or Block? (Because ... sometimes when something is selected and the button is showing me "Unblock" I can still see the element in the page, and vice versa. It confuses me to no end.)
I'd rather have really long tooltip helptexts or another help button readily available instead having to return to the tutorial bookmark.
Sorry for probably sounding so negative, I do not mean to
I have gallery pages with thumpnails I can't see, I fail to set things up so I can see thumpnails in youtube either. Even with your tutorial (Ctrl+Server. When I did that, the lil' thumpnails showed up, but now - sometimes they're there, but only for half a second before they are wiped off the screen again. It's like the script never deletes prefs and only stacks them up and does *everything* in the stock, one by one.
For now, I'm going back to the older version of your script that only disables javascripts I don't want. But I will come back to read up on what's happening. Perhaps try again.
Wednesday, 9. July 2008, 14:21:10
Originally posted by Jammet:
You could set imgblockIt to false in the script, just like you can set iframeblockIt and mediablockIt to false also. If you do like this:I have gallery pages with thumpnails I can't see, I fail to set things up so I can see thumpnails in youtube either. Sometimes they're there, but when I reload the page they are gone again. I'm going back to the older version of your script that only disables javascripts I don't want.
var imgblockIt = false;
var iframeblockIt = false;
var mediablockIt = false;
that will only block javascript, but its a shame, its a great tool. Can you give out some more examples were it fucks up for you? I will love to help you dude, thats why were here Wednesday, 9. July 2008, 14:53:15 (edited)
Originally posted by rfudk:
Well, I dont think its fair that you critisize so much, maybe you really are to stupid for this great tool then? Sorry to say. I can't see how it could be more documented than it allready is? I've been using this from day 1, never had a single problem! Well, that was not to be harsch! Sorry.
Please allow me to criticise, I don't feel like I have been overly unfair. And yes, chances are that I am simply too stupid
I will go over the situation again. Let's say you go to youtube and you find the page looks ... almost blank. You want the preview thumpnails at the very least.
I would normally, by intuitition assume that the "Server" button basically switches between what you describe as var imgblockIt = false / var imgblockIt = true;. Or that it simply allows even off-server images to pass and be displayed. Sorta like an On/Off switch for the mode you are in, and saves that setting for the domain you are at: in my case that's images from youtube.com.
But it works different, I couldn't quite follow the description.
Whenever I reload a page, the userjs BlockIt goes back to script unblock or block mode. Mistakenly thinking I was still in image block/unblock mode, I clicked on Ctrl+Server. Realising my mistake, I did that again, thinking that'd simply undo it. It doesn't, right? Here is probably where my intuition fails me again, because I just assumed it would correct my mistake.
I reload youtube. "This time I am going to do it right." I think, and I select Image mode first, and then click Ctrl+Server. Nothing happens. I try various combinatons .. probably saving lots of instructions into the cookies. I keep reloading, I keep deleting cookies. I keep coming back, accidentally repeating my first mistake about confusing Script mode with Image mode a few times. By now, the thumpnails show - or some of them do - for a split second before they are wiped off the screen again. By that time I am frustrated, and I give up at that point.
I might keep the script around for blocking media, inlines and other javascripts, but I will most likely disable it managing the images, because - for me - the built in image blocker seems to do better, and that in conjuction with the good old AdBlocker.css file did work fine for several years now.
Saturday, 12. July 2008, 08:10:16
Sunday, 13. July 2008, 00:34:17
After disabling the image handling like I said I would (like you also have) everything works out pretty nicely. No problems anymore whatsoever.
Saturday, 19. July 2008, 20:08:56
Peace & Gratitude,
CogitoErgoSum
Saturday, 19. July 2008, 20:58:44
Originally posted by CogitoErgoSum:
Do you mean the settings we're talked about some post's up? Just open the file in a editor like notepad (i used notepad2) you could also use notepad++ .. the regular notepad always shows the file uncorrect :\Excuse my ignorance, how do I specifically go about editing or changing the BlockIt file settings.
Did i misunderstand you?
Saturday, 19. July 2008, 22:17:23
Originally posted by rfudk:
Originally posted by CogitoErgoSum:
Do you mean the settings we're talked about some post's up? Just open the file in a editor like notepad (i used notepad2) you could also use notepad++ .. the regular notepad always shows the file uncorrect :\Excuse my ignorance, how do I specifically go about editing or changing the BlockIt file settings.
Did i misunderstand you?
Hello rfudk,
Thanks for the help. Now it is clear.
Peace & Gratitude,
CogitoErgoSum
Monday, 21. July 2008, 17:16:42
Thought you would like to know.
Saturday, 9. August 2008, 07:18:51 (edited)
Honestly, I wasn't sure if it was possible to achieve NoScript functionality with Opera's current userJS model. I'm very happy to be back on Opera after several years. Thanks again for your hard work. I hope the Opera developers incorporate this into version 10 (or at least send you a cake!).
EDIT: I've been playing around with this for a day now, and I'm noticing that some media/scripts are still able to sneak past this userJS. For example, the media on http://www.jakeandamir.com is not blocked in Opera+BlockIt, but Firefox+NoScript stops it. Can you take a closer look at your method when you get a chance?
Sunday, 10. August 2008, 00:41:34
Originally posted by flanker:
EDIT: I've been playing around with this for a day now, and I'm noticing that some media/scripts are still able to sneak past this userJS. For example, the media on http://www.jakeandamir.com is not blocked in Opera+BlockIt, but Firefox+NoScript stops it. Can you take a closer look at your method when you get a chance?
Maybe this failure is because there is no explicit blocking of <object> elements?
Wednesday, 20. August 2008, 12:19:23
For example: on www.vrtnieuws.net (Belgian news site) not all scripts and images are shown in the list. The embedded flash, which is probably triggered by a javascript (determined from a quick glance at the source, might be wrong) is also not shown in the list of blockable elements.
Apart from that, it seems nice, keep it up
Monday, 1. September 2008, 21:37:45
According to the file, the default location is at the bottom right corner...it doesn't show up there.
Nor does it show up when I change the location. Currently, the location is set at: var cornerposition = 2
I have gone to TOOLS>PREFS and I don't find anything there with respect to it { blockit icon} showing up.
I have the blocki.js file located in C>PROGRAM FILES>OPERA>PROFILE
I also recycled or re-started Opera several times with no apparent luck to have the BlockIt icon display anywhere in any corner.
No luck.
Monday, 1. September 2008, 23:56:50 (edited)
First, create a folder exclusively for user js. anywhre you like if you don't have one, with any name you like, and save Blockit.js and others (if you have) to that folder. Then go to "Tool > Preferences > Advanced > Content > Javascript Options > User Javascript files > Choose" to the location of the folder. That's it. And you don't have to restart. Just reload the page and you'll see the button. Enjoy! I really like it.
If you have other tabs open before doing this, you should reload them at first.
Thank you very much! shoust.
Tuesday, 2. September 2008, 03:47:57 (edited)
Thanks very much. It worked exactly as you instructed.
Though I had to restart the browser rather than refresh it. Nevertheless, the icon does show up. Thanks again.
Though I have one more question.
How does one remove the Redirection Status message that appears stating the following:
The URL was redirected to . Please click the link to go there. You can enable the automatic redirection in Preferences
I have also looked inside the prefs and can't find much, or at least I am unfamiliar with what to check or uncheck there.
Tuesday, 2. September 2008, 09:47:10
Originally posted by badnonsense:
@kslee:
Though I had to restart the browser rather than refresh it.
Strange! It' been a long time since created my js folder so I tried a new, moving, changing folder but reloading works.
Anyway, glad to hear it's working now.
Originally posted by badnonsense:
You can enable the automatic redirection in Preferences
Tools > Preferences > Advanced > Netwok > tick 'Enable automatic redirection'
Tuesday, 2. September 2008, 22:48:13
I just wanted to say 'thank you' for your help.
Thursday, 4. September 2008, 15:04:53
http://gemal.dk/browserspy/
And it appears that the real reason for blocking javascript is not fulfilled. All the info could still be obtained with blocking the scripts through BlockIt.
Thursday, 11. September 2008, 11:11:05
Wednesday, 24. September 2008, 12:19:58
I like the script a lot, but i would like a version that works in the opposite way. What i mean by that is that it doesn't block anything at first and i have to select what gets blocked (as in it uses a "BlackList", not a "WhiteList" like it does now).
Is it hard to modify it that way ? maybe add a flag in the config part so you can choose which way you want it to work (block everything and you choose what to allow or allow everything and you choose what to block).
Monday, 24. November 2008, 15:00:47 (edited)
I was just going through all your noscript.js stuff on the other posting so nice to see an up-up-up to date js. Like the Preview button as I was never sure if the defualt block was blocking anything.
[UPDATE]
Actually I have come across one problem.
On gmail I dont have any icon in the bottom corner of the page. One of the google igadgets I have set up in gmail (for remember the milk) is not showing up.
All it says at the bottom of the google gadget window is "BlockIt can't be viewed at this width"
How do I get the icon back? (It is showing up for every other website I visit excpet this.) Can I "Switch off" BlockIt for a particular website? Any other way of a work around?
I have tried using the bookmarklet you put in your documentation but same results.
I have incuded a screen shot.RtM_BlockIt_Capture.PNG
Friday, 19. December 2008, 06:21:05
Monday, 12. January 2009, 22:31:30
while using your script for quite a while now I had the problem that my girlfriend is not good enough in english, and so I decided to translate it for my use.
Well, almost everything was easy to find out and it works really good exept for the block/unblock toggle button. When used once it won´t change back. I translated only the a.value entries. Any idea what other part should be translated?
BTW, maybe it would be a good idea if we could have your guide to blockit in german language too. If you´re interested I could assist you
in translating it.
Cheers
thomas/schonok
www.schonok.de
Friday, 23. January 2009, 08:18:14
Originally posted by agath:
Any idea how to move that BlockIT icon to the status bar?
Nice script! I'm very much for the minimalist look though and that icon catches my eye too easily. Changing it to a button/widget would be awesome. At the very least, how do I change the icon size or the icon itself? Can I make it transparent?
-Viewy
Friday, 23. January 2009, 08:36:57
if (blockedReferrer )
document.write ("&referer=" + escape(blockedReferrer ));
It's found inside the <body> then <script> tag of the page.
Possible? Alternatives? Any ideas?
-Viewy
Friday, 13. March 2009, 18:10:55
Originally posted by shoust:
Hi, I am a new Opera user, and would like to use your Block-it. I see your instructions for using it, but don't see a place to download the app. How do I install Block-it? ThanksThis is a userjs that almost mimics NoScript, but does one better!
NoScript is a firefox extension that allows selective blocking and unblocking of external scripts on the page which is its basics.
But when compared to my script, mine allows selective blocking and unblocking of Images, Iframes, and Embedded content on the page!
There is documentation of my script available here , which is probably better explained than here.
Enjoy
BlockIt.js
Some of you might notice that this is similar to a previous script I made, it is, it was called "Ultimate Blockage", but I've renamed it and reversed the blocking/unblocking process too, and now the old version of it lies hidden deep within the depths of this thread.![]()
Wednesday, 18. March 2009, 15:09:32
( see Tools -> Preferences -> Advanced -> Content -> JavaScript options)
Friday, 12. June 2009, 23:10:15
In any case again, thank you for the work you put into this.
Harry
Saturday, 13. June 2009, 09:50:55
mine allows selective blocking and unblocking of ... Iframes
«display:none» does not block Iframes, only hides the content.
viewy21
is it possible to block certain parts of a script written explicitly in the page?
Yes, use BeforeScript.
browzer1
Firefoxs' NOSCRIPT is updated quite regularly.
1) NoScript has advanced features such as the «Anti-XSS protection» that require fairly frequent updates.
2) With each update, it shows the author's page containing the advertisement. Frequently updated -> more money
Saturday, 13. June 2009, 11:55:16
if (blockedReferrer )
document.write ("&referer=" + escape(blockedReferrer )); from running, I use a user javascript file containing a BeforeScript event listener to catch it and make return a blank or render it null. I understand the concept, but I'm not sure how to add the above code into the BeforeScript syntax. Can you guys help me out on this? Thank you in advance!-Viewy
Side note: @Lex1: Your Adblock.js is awesome! I think the 10 beta's directories have now changed and now Adblock doesnt work anymore? (or maybe I screwed something up...)
Saturday, 13. June 2009, 14:21:05
if(location.hostname.replace(/^www\./, '') == 'site.com'){
opera.addEventListener('BeforeScript', function (e){
if(e.element.text.indexOf('escape(blockedReferrer') != -1)e.preventDefault();
}, false);
};
10 beta's directories have now changed and now Adblock doesnt work anymore?
The installer has been updated.
Saturday, 11. July 2009, 21:32:16
Tuesday, 21. July 2009, 21:37:44
1. A list with scripts which are always allowed. It's a little bit annoying to accept a script/server/page every and every time.
2. A button for toolbars instead the one in the corner. (Perhaps short click: show options like now; long click: show the whitelist and an option to enable/disable BlockIt completely)
Best regards
Wednesday, 22. July 2009, 08:09:59
2. Semi-possible, however there isn't a way to show options in the browser ui, or indicate if there are any scripts in the page, in operas ui
Showing topic replies 1 - 50 of 60.
Forums » Opera Community » General Opera topics » User JavaScript
