How does 'block requests for missing resources" actually work? #65

Closed
opened 1 year ago by MPeter · 9 comments
MPeter commented 1 year ago

It was unknown to me also when I was using Decentraleyes. If I enable this option, exactly what will be blocked?

  1. Everything? (css, images, media, scripts, frames from every source)
  2. Everything, but only from known CDNs?
  3. Only scripts and css, but all of them?
  4. Only scripts and css, but only from known CDNs?
  5. Some other option?

I use both uMatrix and uBlock. uMatrix is my main filtering tool, and I keep it in whitelist mode and am perfectly fine with constantly tuning it's filtering settings when I visit a new site, and uBlock is just there with almost defaults because it has a few features that uMatrix haven't got

In case your answer is one of the first 3 options, would it be possible for your extension to check if uMatrix is in whitelist mode, and allow loading the resource if it was whitelisted in uMatrix? I guess uMatrix would have to support it too. If it's possible, it would be cool to list these resources in the popup list too, but with a different background color or some other decoration to make them look different.

It was unknown to me also when I was using Decentraleyes. If I enable this option, exactly what will be blocked? 1. Everything? (css, images, media, scripts, frames from every source) 2. Everything, but only from known CDNs? 3. Only scripts and css, but all of them? 4. Only scripts and css, but only from known CDNs? 5. Some other option? I use both uMatrix and uBlock. uMatrix is my main filtering tool, and I keep it in whitelist mode and am perfectly fine with constantly tuning it's filtering settings when I visit a new site, and uBlock is just there with almost defaults because it has a few features that uMatrix haven't got In case your answer is one of the first 3 options, would it be possible for your extension to check if uMatrix is in whitelist mode, and allow loading the resource if it was whitelisted in uMatrix? I guess uMatrix would have to support it too. If it's possible, it would be cool to list these resources in the popup list too, but with a different background color or some other decoration to make them look different.
nobody added the
question/discussion
label 1 year ago
Owner

If I enable this option, exactly what will be blocked?

Well, there's no blocking. LocalCDN and Decentraleyes use a redirection for certain requests. There is a mapping file, where the source (all CDNs and the path to the frameworks) are listed and a resource file, where the destination is defined. (Number 4)

Currently only JavaScript and CSS files are redirected. Some CSS files refer internally to other files, e.g. Font Awesome. All requests are redirected to a local file, e.g. jQuery. This is the reason why the extension is 10 MB.

Only if LocalCDN cannot find a local resource (and the option is enabled) will block a request.

uBlock Origin and uMatrix only affect LocalCDN by blocking requests. To allow LocalCDN to receive and redirect the requests, uBlock/uMatrix must allow the request.

> If I enable this option, exactly what will be blocked? Well, there's no blocking. LocalCDN and Decentraleyes use a redirection for certain requests. There is a [mapping file](https://codeberg.org/nobody/LocalCDN/src/branch/main/core/mappings.js#L71), where the source (all CDNs and the path to the frameworks) are listed and a [resource file](https://codeberg.org/nobody/LocalCDN/src/branch/main/core/resources.js#L328), where the destination is defined. (Number 4) Currently only JavaScript and CSS files are redirected. Some CSS files refer internally to other files, e.g. Font Awesome. All requests are redirected to a local file, e.g. [jQuery](https://codeberg.org/nobody/LocalCDN/src/branch/main/resources/jquery). This is the reason why the extension is 10 MB. Only if LocalCDN cannot find a local resource (and the option is enabled) will block a request. uBlock Origin and uMatrix only affect LocalCDN by blocking requests. To allow LocalCDN to receive and redirect the requests, uBlock/uMatrix must allow the request.

Should this be added to the readme.md file?

Should this be added to the `readme.md` file?
nobody referenced this issue from a commit 1 year ago
Owner

@unbeatable101: Good idea. What do you think about this?

@unbeatable101: Good idea. What do you think about [this](https://codeberg.org/nobody/LocalCDN/commit/33399d1a1113872fc8974887bad4421c67cbefae?style=unified)?

@nobody, I think it looks good!

@nobody, I think it looks good!
Poster

Thank you! So it's basically the 3rd option, and not the 4th, right?

Also, it's not really about the project, but this website: for some reason a lot of buttons (e.g. the ... where the option would be to reply, the 2 buttons right to the notifications button on the top bar) are not working. Did you experience this earlier?

Thank you! So it's basically the 3rd option, and not the 4th, right? Also, it's not really about the project, but this website: for some reason a lot of buttons (e.g. the ... where the option would be to reply, the 2 buttons right to the notifications button on the top bar) are not working. Did you experience this earlier?

I belive it is the third option, but the requests that localcdn can serve will not be blocked.

I belive it is the third option, but the requests that localcdn can serve will not be blocked.
Owner

Number 4 is already correct, because the CDNs are listed in the mappings.js and also include the full path to the JavaScript or CSS file. (= 4. Only scripts and css, but only from known CDNs). Example: You visit the website www.example.com. All JavaScript and CSS files from www.example.com and subdomain.example.com are allowed. If a JavaScript or CSS file is to be loaded from cdn.i-am-watching-you.com, it is not blocked. Unless, of course, your adblocker blocks it.

If a match exists, the request is redirected to a local file. If there is no match, the request is passed to the original destination (default setting) or blocked (no default setting, but imho recommended).

Number 4 is already correct, because the CDNs are listed in the [mappings.js](https://codeberg.org/nobody/LocalCDN/src/branch/main/core/mappings.js#L35) and also include the full path to the JavaScript or CSS file. (= 4. Only scripts and css, but only from known CDNs). Example: You visit the website www.example.com. All JavaScript and CSS files from **www.example.com** and **subdomain.example.com** are allowed. If a JavaScript or CSS file is to be loaded from **cdn.i-am-watching-you.com**, it is not blocked. Unless, of course, your adblocker blocks it. If a match exists, the request is redirected to a local file. If there is no match, the request is passed to the original destination (default setting) or blocked (no default setting, but imho recommended).
Owner

Also, it’s not really about the project, but this website: for some reason a lot of buttons (e.g. the ... where the option would be to reply, the 2 buttons right to the notifications button on the top bar) are not working. Did you experience this earlier?

@MPeter:

Sorry, I forgot to answer that question. No, I've never had a problem like this before. I would use about:profiles to create a new Firefox profile and test if everything works.

If the problem still exists, you can create a Codeberg problem. (I'm only a user and donator)

If the problem no longer exists, it's caused by a setting or an extension.

> Also, it’s not really about the project, but this website: for some reason a lot of buttons (e.g. the ... where the option would be to reply, the 2 buttons right to the notifications button on the top bar) are not working. Did you experience this earlier? @MPeter: Sorry, I forgot to answer that question. No, I've never had a problem like this before. I would use `about:profiles` to create a new Firefox profile and test if everything works. If the problem still exists, you can create a [Codeberg problem](https://codeberg.org/Codeberg/Community/issues). (I'm only a user and donator) If the problem no longer exists, it's caused by a setting or an extension.
Poster

Thank you. It seems I've found the problematic plugin, weird because it's only supposed to re-enable the right click context menu

Thank you. It seems I've found the problematic plugin, weird because it's only supposed to re-enable the right click context menu
MPeter closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.