using Intercept & Modify HTTP Response

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

Goodydino
Keeps coming back
Keeps coming back
Posts: 972
Joined: 2017-10-10, 21:20

using Intercept & Modify HTTP Response

Post by Goodydino » 2026-04-18, 21:40

When using Intercept & Modify HTTP Response, how do I assemble the Search string to go with the replacement? If there are dozens of replacements to be done, do I put in wildcards to try to match up with the replacement?
There was a file in the zip file called Help.js. What is that for? I can read the source code, but trying to follow what it is suggesting is not something I understand well. How is that file supposed to be used?

User avatar
tellu-white
Lunatic
Lunatic
Posts: 334
Joined: 2022-03-08, 22:02
Location: Arad, Romania

Re: using Intercept & Modify HTTP Response

Post by tellu-white » 2026-04-19, 16:20

Goodydino wrote:
2026-04-18, 21:40
When using Intercept & Modify HTTP Response, how do I assemble the Search string to go with the replacement? If there are dozens of replacements to be done, do I put in wildcards to try to match up with the replacement?
There was a file in the zip file called Help.js. What is that for? I can read the source code, but trying to follow what it is suggesting is not something I understand well. How is that file supposed to be used?
I'm not quite sure what you're trying to do. You say, "If there are dozens of replacements to be done ...". You don't specify whether all these "replacements" are for the same URL pattern ("host" + "path") or for different patterns. However, in both cases, each "replacement" must have its own "search" + "replace" pair.

In the screenshot (example) below, there are two URL patterns for which "replacements" are made:

Patern 1:

host = /developer.mozilla.org/
path = /.*\/docs\/.*/

Patern 2:

host = /developer.mozilla.org/
path = /.*\.js.*/

For the first pattern, there are 6 pairs of "search" + "replace," while for the second pattern, there is only a single pair of "search" + "replace":

Screenshot:
01.png

**********

I haven't updated the "Help.js" file because (over time) many explanations have been added, illustrated with screenshots. For this reason, I've posted a JavaScript that can be used to save to disk all the forum pages where I've posted HELP for this add-on. Please read my post here:

https://forum.palemoon.org/viewtopic.php?f=71&t=32889#p268028
You do not have the required permissions to view the files attached to this post.
Telu (with a single L) was the name of the dog of one of my grandparents - when I was just a little boy.
He was a white dog of large size and very friendly.

Goodydino
Keeps coming back
Keeps coming back
Posts: 972
Joined: 2017-10-10, 21:20

Re: using Intercept & Modify HTTP Response

Post by Goodydino » 2026-04-19, 18:34

I read that linked page and followed all the links you posted in them. I did not see any link to a javascript.
I copied some of the suggested replacement codes in the Web Compatibility forum, but I do not know exactly how to match the source with the replacement.
I got the impression that the help.js file is supposed to do something, but I do not know how to use it.

User avatar
tellu-white
Lunatic
Lunatic
Posts: 334
Joined: 2022-03-08, 22:02
Location: Arad, Romania

Re: using Intercept & Modify HTTP Response

Post by tellu-white » 2026-04-20, 14:46

Goodydino wrote:
2026-04-19, 18:34
I read that linked page and followed all the links you posted in them. I did not see any link to a javascript.
I copied some of the suggested replacement codes in the Web Compatibility forum, but I do not know exactly how to match the source with the replacement.
I got the impression that the help.js file is supposed to do something, but I do not know how to use it.
The JavaScript code I mentioned in my previous post isn’t used for managing filters, but for saving to disk the pages with HELP posts for the "Intercept & Modify HTTP Response" add-on.

The JavaScript code is displayed directly on the page - there is no "link to a javascript".

Important: this JavaScript code only works if your operating system is Windows.

Here is the JavaScript code:
01.png
https://forum.palemoon.org/viewtopic.php?f=71&t=32889#p268028

With this JavaScript code, you need to create a new button using the add-on "Custom Buttons Enhanced 0.0.6" (after installing the add-on, place the JavaScript code in the "Code" TAB of the newly created button):

https://forum.palemoon.org/viewtopic.php?f=71&t=32626

After creating this button, follow the instructions here ( https://forum.palemoon.org/viewtopic.php?f=71&t=32889#p268028 ) to save the following HELP pages to disk:

https://forum.palemoon.org/viewtopic.php?f=70&t=31829

https://forum.palemoon.org/viewtopic.php?f=70&t=31829&start=20

https://forum.palemoon.org/viewtopic.php?f=70&t=31829&start=40

https://forum.palemoon.org/viewtopic.php?f=71&t=32889


**********

You can't just copy "replacement codes" from the forum at random, because each filter is designed to solve a specific problem and can't be used as a universal workaround. However, if you’ve found filters on the forum for the page where you’re having issues, please post the URL of that specific page as well as the URLs of the forum posts containing the filters you found. This will help me understand the “how to match the source with the replacement” issue you’re referring to.
You do not have the required permissions to view the files attached to this post.
Telu (with a single L) was the name of the dog of one of my grandparents - when I was just a little boy.
He was a white dog of large size and very friendly.

Goodydino
Keeps coming back
Keeps coming back
Posts: 972
Joined: 2017-10-10, 21:20

Re: using Intercept & Modify HTTP Response

Post by Goodydino » 2026-04-20, 17:43

If that javascript is only for Windows, I am out of luck. I have MacOS.
As for the replacement codes, I was trying to match them with the source of the pages mentioned.
I think maybe I should just go back to using a different browser if a page does not work with the one I use at first.