minbrowser / min

A fast, minimal browser that protects your privacy
https://minbrowser.org/
Apache License 2.0
7.93k stars 702 forks source link

Adblock is important #376

Open Ox16 opened 7 years ago

Ox16 commented 7 years ago

Hello, Is possible to add small list to blocking ads by hand? Or change default new page to the list mode? I hate ads. And import/export list f blocking images/script to file or database.

PalmerAL commented 7 years ago

Is possible to add small list to blocking ads by hand?

Not yet; I agree that would be a useful feature to have.

Or change default new page to the list mode?

I'm not sure I understand what you mean. Do you mean having filtering enabled by default?

code-hunger commented 7 years ago

How does the current ad blocker work? I searched for "blocker" or "adblock" through the repo but didn't find anything useful. I don't think adding customize options for the ad blocker should be particularly difficult.

PalmerAL commented 7 years ago

@code-hunger The core filter-parsing and checking logic is here: https://github.com/minbrowser/min/blob/master/ext/abp-filter-parser-modified/abp-filter-parser.js. When the browser loads, https://github.com/minbrowser/min/blob/master/js/filteringRenderer.js reads the settings database, and sends a message to https://github.com/minbrowser/min/blob/master/main/filtering.js, which sets up the webRequest listener. To make the filter lists customizable, you would probably need to add a setting with a list of filters and a property named something like hasPendingUpdates. When the browser starts, filteringRenderer.js would check if the filter list had changed, and if it has, tell the main process what the new filter lists are. The main process would re-download them all, combine them, save them in a file in the users profile directory (so they can be used the next time the browser starts up), and then re-parse the new filters.