dudik
dudik / blockit Goto Github PK
View Code? Open in Web Editor NEWWebKitGTK adblock extension with Brave's Rust-based adblock engine for backend.
License: GNU General Public License v3.0
WebKitGTK adblock extension with Brave's Rust-based adblock engine for backend.
License: GNU General Public License v3.0
Hello,
I get this error when compiling the current master (be185b4) on Ubuntu 20.04:
%sudo make install
cc blockit.c resources/gschema.c -o blockit.so -fPIC -shared `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0 glib-2.0 gio-2.0`
blockit.c: In function ‘web_page_send_request’:
blockit.c:34:2: warning: implicit declaration of function ‘g_uri_split’ [-Wimplicit-function-declaration]
34 | g_uri_split(request_uri, G_URI_FLAGS_NONE, NULL, NULL, NULL, NULL, &path, NULL, NULL, NULL);
| ^~~~~~~~~~~
blockit.c:34:27: error: ‘G_URI_FLAGS_NONE’ undeclared (first use in this function); did you mean ‘G_RESOURCE_FLAGS_NONE’?
34 | g_uri_split(request_uri, G_URI_FLAGS_NONE, NULL, NULL, NULL, NULL, &path, NULL, NULL, NULL);
| ^~~~~~~~~~~~~~~~
| G_RESOURCE_FLAGS_NONE
blockit.c:34:27: note: each undeclared identifier is reported only once for each function it appears in
blockit.c: In function ‘console_message_sent_callback’:
blockit.c:118:25: error: ‘G_URI_FLAGS_NONE’ undeclared (first use in this function); did you mean ‘G_RESOURCE_FLAGS_NONE’?
118 | g_uri_split(page_uri, G_URI_FLAGS_NONE, NULL, NULL, &path, NULL, NULL, NULL, NULL, NULL);
| ^~~~~~~~~~~~~~~~
| G_RESOURCE_FLAGS_NONE
blockit.c: In function ‘document_loaded_callback’:
blockit.c:102:3: warning: ignoring return value of ‘jsc_context_evaluate’, declared with attribute warn_unused_result [-Wunused-result]
102 | jsc_context_evaluate(js_context, res->str, -1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
blockit.c: In function ‘pick_elem’:
blockit.c:160:2: warning: ignoring return value of ‘jsc_context_evaluate’, declared with attribute warn_unused_result [-Wunused-result]
160 | jsc_context_evaluate(js_context, zap_js, -1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
blockit.c: In function ‘block_elem’:
blockit.c:170:2: warning: ignoring return value of ‘jsc_context_evaluate’, declared with attribute warn_unused_result [-Wunused-result]
170 | jsc_context_evaluate(js_context, block_js, -1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:12: blockit.so] Error 1
Am I missing something?
Hello,
I try to get blockit running on an OpenBSD -current machine. I opened 2 urls after another. The actual webpage is not rendered. It errors out with the following:
~/.cargo/bin $ RUST_BACKTRACE=full ./adblock-rust-server
init-done
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/claudia/.cargo/registry/src/github.com-1ecc6299db9ec823/adblock-rust-server-0.1.0/src/main.rs:33:58
stack backtrace:
0: 0x416d24a90c - <unknown>
1: 0x416d279bbd - <unknown>
2: 0x416d245ac4 - <unknown>
3: 0x416d25db34 - <unknown>
4: 0x416d25d721 - <unknown>
5: 0x416d25e14c - <unknown>
6: 0x416d24ae62 - <unknown>
7: 0x416d24aa40 - <unknown>
8: 0x416d25dcf6 - <unknown>
9: 0x416d27bd40 - <unknown>
10: 0x416d27bc98 - <unknown>
11: 0x416d0c13fc - <unknown>
12: 0x416d0bc9e5 - <unknown>
13: 0x416d0c300e - <unknown>
14: 0x416d2639ed - <unknown>
15: 0x443dd62e11 - <unknown>
16: 0x446813f63a - <unknown>
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', /home/claudia/.cargo/registry/src/github.com-1ecc6299db9ec823/adblock-rust-server-0.1.0/src/main.rs:52:38
stack backtrace:
0: 0x416d24a90c - <unknown>
1: 0x416d279bbd - <unknown>
2: 0x416d245ac4 - <unknown>
3: 0x416d25db34 - <unknown>
4: 0x416d25d721 - <unknown>
5: 0x416d25e14c - <unknown>
6: 0x416d24ae98 - <unknown>
7: 0x416d24aa40 - <unknown>
8: 0x416d25dcf6 - <unknown>
9: 0x416d27bd40 - <unknown>
10: 0x416d277e86 - <unknown>
11: 0x416d0c132c - <unknown>
12: 0x416d0bc9e5 - <unknown>
13: 0x416d0c300e - <unknown>
14: 0x416d2639ed - <unknown>
15: 0x443dd62e11 - <unknown>
16: 0x446813f63a - <unknown>
Hi
With WebKitGTK sandbox activated (as it is in my own browser, badwolf) it shouldn't be possible to start the server, I think there should be an error message (fprintf(stderr, …)
or maybe a GTK popup if that can work) instead of silently exiting.
(Also not sure if /tmp/ars
is reachable in the sandbox, it probably isn't)
This is a small TODO list for myself. The extension is usable, but some things need to be fixed/implemented. Feel free to open new issues for other problems you encounter.
i've installed blockit following to the readme. I am not sure if it is even starting correctly but i got 62/100 in the adblock-tester.com tester and i dont think surf blocks that much adds by default (not patched at all).
If i open blockit://settings in surf it redirects me to http://blockit//settings and i get a page not found error.
What i tried:
Editing surf.c to not add http:// to the address
add https/http to the url by hand.
Both did not work.
I know this might sound like a surf issue, but maybe you can give me a hint how surf should behave to open the site correctly or tell me if this means that the extension is not running
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.