My programs for Opera

NoAds. (NoScript+AdBlock)/2

, ,

NoAds.js 1.1.3 final (58 Kb)
noads.oex - для Opera 11.
NoAds.js 1.0.3 для Opera 9.5-10.54

Скрипт представляет собой компиляцию adblock.js, block-external-scripts.js и abp_import.js и использует глобальное хранилище scriptStorage, появившееся в Opera 10.6, для сохранения настроек.

Возможности:
Блокирование скриптов с других доменов, которые в 99% случаев являются рекламой.
Блокирование элементов страницы, включая текстовую рекламу.
Импорт подписок AdBlock Plus EHH.
Блокирование встроенных в страницу скриптов.

Кнопка быстрого отключения/включения находится в правом нижнем углу страницы. Показывается при наведении.




Установка:
Скрипт устанавливается как обычно, но кроме этого нужно выставить настройку opera:config#PersistentStorage|UserJSStorageQuota >= 500

Кнопки:
Настройки NoAds
Блокировать рекламу
Блокировать элемент страницы
Разблокировать
Разблокировать последнее
Content block Helper

Горячие клавиши:
Настройки - Alt+Shift+P

Блокирование рекламы - Alt+Shift+A
Блокирование элемента страницы - Alt+Shift+B
Разблокирование - Alt+Shift+U
Разблокирование последнего элемента - Alt+Shift+L

(раз)Блокирование нескольких элементов - Shift+Click

Документация
Css-фильтры: http://adblockplus.org/ru/filters#elemhide

Блокирование скриптов:
@@== - Белый список блокировщика внешних скриптов. Обычные регулярки, с единственным отличием - точка после которой следует алфавитно-цифровой символ, считается не спецсимволом, а обычной точкой (с версии 1.1.3).
##$$ - Блокирование встроенных в страницу скриптов, в которых будет найдено совпадение. Используются аналогичные регулярки. Например «localhost##$$document.write» заблокирует на localhost-е все скрипты в которых упоминается «document.write»


Short description in English

UserJS: NoAds.js 1.1.3 final (58 Kb)
noads.oex - for Opera 11.

Functions:
Block external scripts, block elements of a page and import subscriptions from AdBlock Plus EHH.

Required options: opera:config#PersistentStorage|UserJSStorageQuota >= 500

"Quick button" (for enable/disable the blocking) is available in the right bottom corner of a page.

Buttons:
NoAds preferences
Block ads
Unblock
Content block Helper


Hotkeys:
Preferences - Alt+Shift+P

Block ads - Alt+Shift+A
Block element - Alt+Shift+B
Unblock - Alt+Shift+U
Unblock latest element - Alt+Shift+L

Block/unblock many elements - Shift+Click

Documentation
Css-filters: http://adblockplus.org/en/filters#elemhide

Scripts blocking:
@@== - White list for script blocking. Standard regexp, with one exception. A dot before any alphanumeric character, is not special character, but an ordinary dot.
##$$ - Inline-scripts blocking. Used the same regexp. Example: «localhost##$$document.write».

Changelog:
1.1
* Using scriptStorage instead of wsh.
* Many improvements.

1.1.1
* Improvements in noads.setRules
* Some compatibility with Opera 9.6

1.1.2
+ Content block Helper. You can easy block iframes and scripts with the internal Opera blocker.
* Selectors tested for validity, before import.
* More logical behavior when switching modes (block/unblock/preferences).

1.1.3
+ Blocking inline-scripts.

Todo
Improvements in noads.setRules
Block js-functions.
Block external images and flash.

For the extension
Disable/enable from menu
Helper mode for internal opera blocker (show scripts)

Known bugs of Opera 11
DSK-316102 (User JS not loaded when page loads too fast)
DSK-318727 (Extension blocks execution of userjs)


FAQ
Q: It doesn't work for me.
A: 1) Please, read the list of known bugs.
2) Set UserJSStorageQuota. It's really needed!
3) If it doesn't help, post the log from Error Console to the comments.

Q: Is this a replacement for the content blocker/urlfilter.ini?
A: Nope. This is an _addition_ to Opera's content blocker.

Q: How to update urlfilter.ini?
A: This is impossible with the current extension api. However, there is a good java application: http://my.opera.com/urlfilterdownloader/blog/

Q: Is it actually block ads or just hide it?
A: Opera doesn't load the hidden content (exclude iframes).

Q: There are many bugs in Opera 11 Alpha...
A: You can use userjs-version noads.js with the stable Opera 10.63.

Using jsonp in bookmarkletsSome userscripts converted to extensions

Comments

RX8 Wednesday, October 13, 2010 9:10:09 AM

ThankS, Ruzanov.

Mağruf ÇolakoğluZAHEK Wednesday, October 13, 2010 9:52:35 AM

Great job. Thanks.
Any chance to implement TR translations in it smile

unblock: 'Serbest bırak: ',
disabled: 'Engelleme durduruldu',
blocked: 'Engellendi',
script: 'betiği',
and: ' ve ',
element: 'elementi',
reload: 'Bu sayfa yeniden yüklenmeli',
nDisabled: 'NoAds iptal edildi',
nEnabled: 'NoAds aktifleştirildi',
eStyles: 'Please, edit styles:',
bElement: 'Bu element(ler) engellensin mi?',
iRules: ' kurallar ',
iContinue: ' içerik indirilecek. Devam edilsin mi?',
pInfo: 'Bilgi',
pClose: 'Kapat',
pGlobal: 'Genel Tercihler',
pSite: 'Site Tercihleri',
pSubscriptions: 'Filtreler',
pHelp: 'Yardım',
pSave: 'Kaydet',
pCss: 'CSS filteri:',
pUCss: 'Kullanıcı css filteri:',
pEnabled: 'Aktifleştirildi',
pScripts: 'Harici betikleri engelle. Beyaz Liste',
pAbout: 'NoAds v1.1',
pSBlocking: 'Betik engelleme aktifleştirildi',
pBDisabled: 'Engelleme tamamen iptal edildi',
pSBlocked: 'Harici betikler engellendi',
pDownload: 'Filtre indir'


Kısayollar:

Tercihler - Alt+Shift+P

Reklam engelle - Alt+Shift+A
Element engelle - Alt+Shift+B
Engellemeyi kaldır - Alt+Shift+U
Son engelleneni geri getir - Alt+Shift+L

Elementleri topluca engelle/kaldır - Shift+Click


Pls confirm Shift+Click is working??

A.RuzanovLex1 Wednesday, October 13, 2010 10:47:05 AM

Updated. Is correct?

Shift+Click is working?


Yes, in block/unblock mode.


P.S. Subscription download are broken in Opera 10.7 build 9067 Known bug.

Mağruf ÇolakoğluZAHEK Wednesday, October 13, 2010 12:47:27 PM

Sorry, this update in russian lang? smile

A.RuzanovLex1 Wednesday, October 13, 2010 1:10:28 PM

I hope this is Turkish smile If you use it in your browser.
http://img508.imageshack.us/img508/4231/20101013200620.png -

PengePenge4 Wednesday, October 13, 2010 8:30:34 PM

Great stuff! Thanks!
I've been waiting for this a long time ago.
Whitelist! At last! yes

Any chance for export/import contents of Script Storage? Or any more convenient way to save my custom site-specific rules?

A.RuzanovLex1 Thursday, October 14, 2010 8:37:49 AM

Or any more convenient way to save my custom site-specific rules?


?
Just copy it from "Global preferences"
http://img837.imageshack.us/img837/2452/20101014153157.png -

A.RuzanovLex1 Thursday, October 14, 2010 1:47:30 PM

Small update. Fixed one bug (misprint) and changed behavior of the quick button (in a right bottom corner of page) to use a new whitelists.
The post also updated. I mixed up a code for the blocking button smile

Mağruf ÇolakoğluZAHEK Friday, October 15, 2010 10:04:54 AM

Sorry, pls try Altf+Ship+P
It doesn't work...

PengePenge4 Friday, October 15, 2010 6:32:17 PM

Originally posted by ZAHEK:

Sorry, pls try Altf+Ship+P
It doesn't work...


It works fine here.
The "Send Referrer information" is enabled?

Unregistered user Saturday, October 16, 2010 8:57:25 AM

Anonymous writes: Hello! MAJOR BUG! If you push the "Delete Private Data" button, all "Css filters" disappear from "Global preferences". Please solve this problem!

A.RuzanovLex1 Monday, October 18, 2010 11:15:26 AM

RC3. An option opera:config#UserPrefs|UserJavaScriptonHTTPS no longer needed.
But you need to add to white list:
@@==^https://easylist-downloads.adblockplus.org/[a-z_+-]+.txt$|^https://secure.fanboy.co.nz/fanboy-adblock.txt$


MAJOR BUG!


http://img685.imageshack.us/img685/6070/20101018181314.th.png -

Unregistered user Monday, October 18, 2010 3:29:58 PM

Anonymous writes: Thank you for your reply! Just do not see the end of the line. .../secure.fanboy.co.nz/fanboy-adblock... :)

BarSerg Monday, October 18, 2010 5:34:38 PM

Спасибо!

BS-Harou Tuesday, October 19, 2010 2:16:04 PM

Very nice! Last +- month I've been developing something similar to block scripts and I recently add the possibility to manage rules of your scritps. Looks like I can remove it now)

Anyway, thank you for update!

Unregistered user Wednesday, October 20, 2010 3:05:59 AM

Аноним writes: Замечательный скрипт.Браво! Однако, осталось несколько вопросов к автору. 1. Для чего служат кнопки "Сохранить" под каждым окном? То-есть: а. должен ли я сохранять настройки для конкретного сайта или они сохраняются автоматически? б. кнопки "Сохранить" используются лишь в случае редактирования, для запоминания его результатов? Или результат ручного редактирования также сохраняется автоматически? в. после использования кнопок "блокировать","разблокировать"- изменения в правилах сохраняются автоматически, или по выходе со страницы я должен их специально "сохранить"? 2. "Блокирование внешних скриптов. Белый список" - могу ли я его редактировать в окне,- "сохранить" результат редактирования или он восстанавливается автоматически? Если - могу - то как вернуться к авторскому варианту? 3. "Подписки". Надо ли специально сохранять загруженный список? Можно ли редактировать, надо ли после этого "сохранять"? Как удалить: выделив всё в окне "Глобальные настройки" (Css фильтры)и Del , или через удаление хранилища? Можно ли добавлять к одному списку другой, и для этого ли служит чекбокс "Добавить правила к существующим"? Что происходит с неизбежными дублями? Есть ли ограничения на объём списка? 4. Ещё о - "Подписки" : "Импортировать все правила" - откуда, в каком формате (ТХТ?),как можно ЭКСПОРТИРОВАТЬ свои правила? 5. "Глобальные настройки. Показывать кнопку быстрого доступа" - о какой именно кнопке речь? 6."Настройки - Alt+Shift+P" - обычно это хоткей для вызова WMP.

A.RuzanovLex1 Wednesday, October 20, 2010 8:46:26 AM

Для чего служат кнопки "Сохранить" под каждым окном?


Для сохранения, при ручном изменении правил.

после использования кнопок "блокировать","разблокировать"- изменения в правилах сохраняются автоматически?


Блокирование внешних скриптов. Белый список" - могу ли я его редактировать?


Естественно.

то как вернуться к авторскому варианту?


Очистить список, сохранить изменения, обновить страницу.

Как удалить: выделив всё в окне "Глобальные настройки" (Css фильтры)и Del


Можно ли добавлять к одному списку другой, и для этого ли служит чекбокс "Добавить правила к существующим"?


Да.

Что происходит с неизбежными дублями?


Явные дубли убираются. Upd. Слегка обновил скрипт, улучшив очистку.

о какой именно кнопке речь?


В правом нижнем углу страницы.

Unregistered user Wednesday, October 20, 2010 2:10:55 PM

JVrVr writes: (A.Ruzanov # 20. October 2010, 08:46) Всё - понял. Огромное Спасибо. (И - за оперативность.=!)

Игорь Воробьев Thursday, October 21, 2010 6:17:40 AM

А где взять эти кнопки не понял?Кнопки:
Настройки NoAds
Блокировать рекламу
Разблокировать

A.RuzanovLex1 Thursday, October 21, 2010 12:54:59 PM

PengePenge4 Thursday, October 21, 2010 4:16:40 PM

Originally posted by Lex1:

Extension version: http://ruzanow.ru/opera/extensions/noads.oex


Conflict with External Scripts

BS-Harou Thursday, October 21, 2010 4:18:58 PM

Originally posted by Penge4:

Conflict with External Scripts



My extension (External Scripts) is the one that doesn't work, so I guess that the problem is on my side. But I really don't see it. sad

EDIT: seems like it is causing access to scriptStorage

withme Thursday, October 21, 2010 6:57:30 PM

hello, is this extension blocking or just hiding elements?

A.RuzanovLex1 Thursday, October 21, 2010 7:07:39 PM

Blocking all except iframes.

withme Thursday, October 21, 2010 7:21:30 PM

amazing, thank you smile

TerDale Friday, October 22, 2010 8:16:48 AM

Excellent, thanks.
Concerning the extension version, why don't you publish it on https://addons.labs.opera.com/addons/extensions ?

Anyway, terrific ujs, kudos!

cyxovi Friday, October 22, 2010 7:24:55 PM

I run Linux (64 bit).

The UserJS version works but Extension version is not working, I click the menu and nothing happens.

Unregistered user Saturday, October 23, 2010 8:59:10 AM

Аноним2 writes: А как удалить скаченный список рекламы?

A.RuzanovLex1 Saturday, October 23, 2010 9:49:15 AM

На клавиатуре есть такая кнопка, Del называется.

SemoregC Tuesday, October 26, 2010 7:16:54 AM

LEX1 у меня не получается переписать скрипт "NoAds" под расширение, если делать по антологии как сделано расширение:
https://addons.labs.opera.com/addons/extensions/download/external-scripts/1.0/

то страница загружается на 3% и всё, без тебя ни как smile

моя попытка (но без этого скрипта):
http://dl.dropbox.com/u/10129887/ad_blok.oex

A.RuzanovLex1 Tuesday, October 26, 2010 8:27:37 AM

А чем не нравится моя реализация?

SemoregC Tuesday, October 26, 2010 12:40:01 PM

А чем не нравится моя реализация?
а где (так уже готово) тыкнешь поильцем?

Цитата:
О проекте OAC - Что дальше?
Сделать доступными все компоненты включённые в OAC в виде адонов (Add-on), т.е что-то вроде расширении для Opera - По этому поводу уже ведётся интенсивная работа.

+ как то ВВ-коде и смалики, да и всё остальное запихнуть в расширение...

думаю так будет проще (и обход лицензии) whistle, или нет?

A.RuzanovLex1 Tuesday, October 26, 2010 8:36:34 PM

Improvements in noads.setRules


Done.
Also added compatibility with opera 9.5. Of course, for you are need the scriptStorage emulator.

а где (так уже готово) тыкнешь поильцем?


Ctrl+F->.oex

как то ВВ-коде и смалики


В данный момент, с помощью расширения, невозможно создать свой тулбар.

Unregistered user Tuesday, October 26, 2010 8:52:52 PM

Anonim writes: I have the same problem as mentioned in the following post: (Linux 32bit) http://my.opera.com/Lex1/blog/noads-noscript-adblock-2#comment44456582

A.RuzanovLex1 Tuesday, October 26, 2010 9:13:41 PM

but Extension version is not working


Welcome to: https://bugs.opera.com/wizard/

TerDale Wednesday, October 27, 2010 7:24:48 AM

Originally posted by Lex1:

but Extension version is not working

Welcome to: https://bugs.opera.com/wizard/

Are you meaning that this is due to an Opera bug? In such a case, you should have already filed a bug, don't you? I'm a bit puzzled anyway, how were you able to test your extension with such a bug....? BTW this is just to understand, as the userjs works great and is really brilliant! Thanks for having taken time to making it public.

A.RuzanovLex1 Wednesday, October 27, 2010 4:44:00 PM

Are you meaning that this is due to an Opera bug?


Yes. Look in error console. Afaik, problem in scriptStorage in extension under Linux.

you should have already filed a bug


Are you the Linux user, right?

TerDale Wednesday, October 27, 2010 5:02:45 PM

Originally posted by Lex1:

Are you the Linux user, right?


Nope, running on W7, same apparent problem though.
However here is what I get in the console, as soon as I click on the extension button, thus before menu display:
JavaScript - widget://wuid-4cc15616-3f63-02dc-03b8-0d422a71f838/menu.html
User Javascript thread
Uncaught exception: TypeError: Cannot convert 'q[0]' to object
Error thrown at line 65, column 4 in <anonymous function>():
    with(q[0].parentNode)
called from line 46, column 0 in program code:
    (function(){

A.RuzanovLex1 Wednesday, October 27, 2010 5:07:36 PM

Do you use another extensions? This is not my code. I'm not use "with".

Unregistered user Wednesday, October 27, 2010 7:28:24 PM

Аноним writes: При попытке добавить поддержку подписок Adblock Plus с помощью команды noads.js ruadlist+easylist.txt /add /all выпадает ошибка Сценарий: noads.js Сторока: 10 Символ: 1 Ошибка: 'window' is undefined Код: 800A1391 Источник: Microsoft Jscript runtime error

A.RuzanovLex1 Wednesday, October 27, 2010 7:44:47 PM

Эта версия не использует wsh. Зайдите в её настройки и скачайте подписку.
В принципе, можно и javascript:window.postMessage('ujs_noads_get_subscription','*') дёргать.

wsp123456 Wednesday, October 27, 2010 11:07:27 PM

Hola me tome el trabajo de traducir la extension NoAds.oex al español.

Para los ineresados aqui dejo el link de descarga noads.oex

http://files.myopera.com/paulwalter/blog/sshot-1.png -

SemoregC Thursday, October 28, 2010 12:57:54 AM

осталось только на нихомво ninja

TerDale Thursday, October 28, 2010 7:17:21 AM

Originally posted by Lex1:

Do you use another extensions? This is not my code. I'm not use "with".



Oops, sorry. Indeed I'm using other extensions, but the culprit is not among them. This is due to one of my userjs. Didn't take the time to identify which one yet.
Sorry for the noise, I was misleaded by the fact that the warning was showing up upon clicking on your extension button.

After wholly disabling my userjs, your extension works fine, well at least I get the preferences screen. Thanks

Unregistered user Thursday, October 28, 2010 4:22:21 PM

Anonym writes: please extend it with a similar function like the "External Scripts" Opera Extension has got. So I'm able to choose which scripts should be blocked and which not, and not only extern scripts. And please add that I can open the dropdown menu with one click on the button and with another one I can close it like it is in the "External Scripts". Could you also add a line break to the imported rules from the Subscriptions tab. When i import them they shown in the Global preferences tab without a line break. anyway, this extension is just great and I love it ;)

Unregistered user Thursday, October 28, 2010 5:48:28 PM

Аноним writes: я лузер...не могу найти настройки где изменить настройку эту...каааак?

A.RuzanovLex1 Thursday, October 28, 2010 5:54:54 PM

opera:config#User JS Storage Quota

So I'm able to choose which scripts should be blocked and which not


I'm not sure what I would do it. Opera blocker already has this feature and it should work faster

Falthin Thursday, October 28, 2010 6:35:35 PM

Excellent extension yes . The only problem that I had is that when I use CCleaner to delete opera cookies it deletes the content from the filter subscription so I have to download it again >_<

One question: What's the difference between the filter subscription and the urlfilter?..I have already Fanboy's adblock list...the filter list from the subscription does the same function? or should I keep both or only one?

Andrew G.consalt Thursday, October 28, 2010 6:59:33 PM

Не работает вместе с http://ruzanow.ru/userjs/FlashBlock.js

Страница становиться непрокручиваемой колесом мышки и некликабельные ссылки на ней, а также страница не не останавливает загрузку.

João EirasxErath Thursday, October 28, 2010 7:02:53 PM

Originally posted by Penge:

Any chance for export/import contents of Script Storage? Or any more convenient way to save my custom


Check here
http://my.opera.com/xErath/blog/opera-is-web-store

If you're not on linux or mac, then you can check pstorage/psindex.dat to check where the data file is, and back it up, so as the xml fragment in psindex.dat.

Write a comment

New comments have been disabled for this post.