Closed jspenguin2017 closed 7 years ago
Violentmonkey uses sooo many dependencies... It's a bit hard to understand how it works without knowing what each dependency does... This is the dependency tree:
Since I'm hard coding the rules into the extension, I think it won't be as complex...
These race conditions should be fixed by extension: https://github.com/reek/anti-adblock-killer/issues/3306
If I'm going to do it, I'll do it right, so I'll refactor the rules to match the new API.
Something like that - https://i.warosu.org/data/g/img/0475/33/1429109973196.png ?
How did you make it?
I didn't 😆 I found it on the Internet so to get an idea of what a base should be.
Eh... that would not work... As it will have licensing and copyright issues...
I'm currently using magic events to communicate between injected script and content script... Hopefully that's solid enough... I don't really trust chrome.runtime
in the injected context as that can be tampered.
You don't have to use that exactly, just edit the render and add something that you believe will represent uBlock Protector and make it yours.
Extension ready for beta test: https://github.com/jspenguin2017/uBlockProtector/tree/master/Extension%20Compiler/Extension
You need to pack the extension in a .zip and then rename it to .crx, then draft a new release in the release section.
I expect developers to use Git to get it, since this extension is a rolling release, create new release every time is too much work.
So you're not going to make .zip and a draft new releases ? I'm not a developer.
This is why I didn't want you to convert it into an extension. Extensions come with tedious chores compared to a user-script.
I will publish it to the store every day or so, not to the GitHub release page because you can just git pull
, I don't see the point in releasing it to GitHub.
Or you can download the whole repository as zip, it's not much difference.
I can pretty much remove all the white lists once the extension is ready for use, and solutions in this extension are executed before uBO's script:inject
.
Okay fine, I will wait for the WebStore release.
you can download the whole repository as zip
That will download the entire repo code which is not needed, you should remove all unnecessary files now as in those which are no longer in requirement by the Extension. A repo clean up is in order.
The whole repository is like 1000kB more, that doesn't take more time to download. I will eventually remove Userscript related files, but not yet since AAK-Cont still rely on them.
Let me know when it's on the WebStore.
Not today probably... I still need to draw an icon.
My take on the icon.
Hum... I need to think about this...
99 cent icons . com
Oh I found the source for uBO-Extra icon, I guess I'll modify it based on that: https://raw.githubusercontent.com/gorhill/uBO-Extra/master/ubo-extra.svg
OK, I got one... whatever works I guess, I'm not artist...
I'm publishing it... hopefully it will go well...
is uBO-Extra integrated ?
Yes, it was actually really simple, I just need to make sure to not touch the global variables that it uses. I actually only use one global variable: a
.
I'm not sure how long it will take... https://chrome.google.com/webstore/detail/ublock-protector-extensio/ggolfgbegefeeoocgjbmkembbncoadlb
Looks like it was approved. That link opens the installation dialog and shows other details about the extension
I'm going to mark it as unlisted, I don't think it make sense to show up in search result...
Options page shows this - https://i.gyazo.com/af459ca53890841d8faccad9ca71c823.png
Yes, that's intended.
I don't suppose you can make an editable interface for the Script.
As without that I cannot test Script based solutions like I used to when it was a user-script.
I'm not going to do that as that will remove the only reason I made it into an extension.
so we can't add or test our solutions in any way ?
As I said before, you need to load the unpacked extension. It needs to be hard coded or it will have race condition. And I'm not going to use an idle loop to delay page load.
The whole purpose of having WebStore extension is not have to install an unpacked extension, otherwise it simply defeats the purpose of installing it from WebStore. Nevermind.
There isn't a way to allow editing the content script, this is the only way to guarantee no race condition. If it's so simple, Violentmonkey would have solved it long time ago.
Is this extension a beta? Will it be only on Chrome?
Yes, it is hard coded for Chrome. It is released, let's call it beta.
The setup was Chrome exclusive even when it was a user-script, so yes.
Can you add an option to disable extension for the current site?
@mikhaelkh No, that is not possible as it would introduce race condition.
@mikhaelkh If it is causing problems on a page, let me know, I can add it to the hard coded whitelist. Also if it is a governmental website or banks or something similar, I can add them to whitelist as well.
@mikhaelkh: There's the extension for doing what you wrote in Chrome called Extension Automation, but I'm not sure how it's on Firefox.
@Piter432 I'm pretty sure by the time that extension finishes fetching its configuration database my extension already finished what it needs to do.
Update: No further updates are allowed in Script as I'm porting the rules over to extension.
Also, I need an icon for the extension and I'm a horrible artist...
After some research, it seems that the content script must be static in order to win race conditions, in order to do so, there will be some major changes to Script. It seems to be possible to use idle loop to block the thread while waiting for callback, but that is very conter-productive on battery powered and/or low power devices as it increases battery drain and locks one CPU core.
My plan is to make Script into an extension, with the script hard coded into the content script file. If done right, this extension should be able to inject the payload before uBlock Origin. Development can be done by side loading unpacked extension.
I might also release a Core-only Userscript to facilitate development.Probably not because I will be using more "native" APIs instead of Violentmonkeys' hacks for the wrapper, there would be some rules scattered across the extension but that's fine, whatever works the best.Also, some weird functionalities in this project will be removed soon, this includes:
The Facebook jump to top button will not be removed because I use it... It will be disabled by default and can be toggled in the settings UI.It is being removed, I will add it to a custom extension that replaces the Userscripts that I use. This will require an asynchronous callback, but as I need to wait for the page to load before adding the button anyway, it's not going to be a problem.I plan to add uBlock Extra integration because it makes a lot of sense and too many extensions can be hard to manage.
I need to think about this...I ended up adding it.