NotHereToPlayGames Posted April 29, 2022 Author Posted April 29, 2022 Could also be a content-type issue. If memory serves, your config is a "start-from-scratch" config because the Swiss Army Knife has too many knives. Can you filter ANY .js files with your config? 1
NotHereToPlayGames Posted April 29, 2022 Author Posted April 29, 2022 On 4/27/2022 at 9:01 AM, UCyborg said: They're supposed to replace: /(?:reddit\.com\/r\/)(?<subreddit>[\w]+)(?:\/comments\/)?(?<postId>[\w]+)?/ /(?:reddit\.com\/r\/)([\w]+)(?:\/comments\/)?([\w]+)?/ And: var s;const{subreddit:o,postId:r}=(null===(s=t.match(i))||void 0===s?void 0:s.groups)||{}; const s=t.match(i),o=null===s[1]?void 0:s[1],r=null===s[2]?void 0:s[2]; 1st line is original, 2nd is replacement. These both work as-is for me --
UCyborg Posted April 29, 2022 Posted April 29, 2022 (edited) 6 hours ago, NotHereToPlayGames said: Could also be a content-type issue. Ohhh, thanks for the hint! Putting application/x-javascript instead of application/javascript works. Both are considered legacy though (https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types - Legacy JavaScript MIME types): Note: Even though any given user agent may support any or all of these, you should only use text/javascript. It's the only MIME type guaranteed to work now and into the future. 6 hours ago, NotHereToPlayGames said: If memory serves, your config is a "start-from-scratch" config because the Swiss Army Knife has too many knives. Yup, I'm clumsy and don't want to cut myself. Those rules from the starting point config break JS left and right on that site. 6 hours ago, NotHereToPlayGames said: Can you filter ANY .js files with your config? Sure can, this was the odd one, all because of MIME type. Edited April 29, 2022 by UCyborg
UCyborg Posted April 30, 2022 Posted April 30, 2022 (edited) On 4/29/2022 at 3:14 PM, NotHereToPlayGames said: My initial hunch is that you have to 'escape' the "=" characters. Yes, that would be better for consistency since expecting minified JS and escaped = is taken as literal without the added documented behavior. On 4/29/2022 at 10:07 PM, UCyborg said: Ohhh, thanks for the hint! Putting application/x-javascript instead of application/javascript works. Now I've put that MIME-List into use and added the following rule: In = TRUE Out = FALSE Key = "Content-Type: Fix MIME types" Match = "(*|(^?))$URL([^/]+*.([a-z0-9]+{2,5}&&$LST(MIME-List))((^?)|\?))" Replace = "\0" Edited April 30, 2022 by UCyborg Threw out HTTP:// bit
NotHereToPlayGames Posted April 30, 2022 Author Posted April 30, 2022 Out of curiosity, how many "filters" are you up to?
NotHereToPlayGames Posted April 30, 2022 Author Posted April 30, 2022 Ah, guess I assumed you were kinda building a new "swiss army knife", but I'd call 14 basically just site-dependent and not "global". 1
UCyborg Posted May 2, 2022 Posted May 2, 2022 Oops, byte limit starts counting from where the match is found. Why did I bother counting preceding bytes?
NotHereToPlayGames Posted May 2, 2022 Author Posted May 2, 2022 On 4/27/2022 at 9:01 AM, UCyborg said: [Patterns] Name = "Reddit - comments page regex 1" Active = TRUE URL = "www.redditstatic.com/desktop2x/CommentsPage.*.js" Limit = 127300 Match = "/\(\?:reddit\\.com\\/r\\/\)\(\?<subreddit>\[\\w\]\+\)\(\?:\\/comments\\/\)\?\(\?<postId>\[\\w\]\+\)\?/" Replace = "/\(\?:reddit\\.com\\/r\\/\)\(\[\\w\]\+\)\(\?:\\/comments\\/\)\?\(\[\\w\]\+\)\?/" Name = "Reddit - comments page regex 2" Active = TRUE URL = "www.redditstatic.com/desktop2x/CommentsPage.*.js" Limit = 127700 Match = "var s;const{subreddit:o,postId:r}=\(null===\(s=t.match\(i\)\)\|\|void 0===s\?void 0:s.groups\)\|\|{};" Replace = "const s=t.match\(i\),o=null===s\[1\]\?void 0:s\[1\],r=null===s\[2\]\?void 0:s\[2\];"
NotHereToPlayGames Posted May 2, 2022 Author Posted May 2, 2022 15 minutes ago, UCyborg said: byte limit starts counting from where the match is found. I wondered why your filter limits were set so high.
UCyborg Posted May 2, 2022 Posted May 2, 2022 Yeah, misunderstood documentation. I've put those two to 128 now.
OutlawHusbando Posted November 20, 2022 Posted November 20, 2022 Great topic, I'm a fan of Proximitron and Scott's godly work (sadly I'll never be able to meet him), hope you'll update this thread.
UCyborg Posted February 2, 2023 Posted February 2, 2023 One thing that one would think would be simple...how do I write a Web Page filter that applies to "localhost" and "localhost/*.html"? If I write "localhost", then it'll match EVERY file coming from localhost, but I only want the root page and whatever other network requests for files end with .html.
NotHereToPlayGames Posted February 2, 2023 Author Posted February 2, 2023 Hmm. I haven't tried that and can't from here at work. You can use header filters "inside" of a web page filter, only if the header is "true" is the web page filter applied. 1
UCyborg Posted February 2, 2023 Posted February 2, 2023 (edited) Looks like I can use: localhost/ $TYPE(htm) Had no idea about it - somehow this page was hiding from me: https://proxomitron.info/45/help/Matching-Commands.html (linked from https://proxomitron.info/45/help/Matching-Rules.html) https://www.prxbx.com/forums/showthread.php?tid=2074 Edited February 2, 2023 by UCyborg 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now