Post

Replies

Boosts

Views

Activity

Reply to Pac File shExpMatch
Yes, pac is being fetched. I’m having an issue specifically with the url string in the function . The host string works fine and executes. The second I switch the code from host to url it stopped working.
Topic: Safari & Web SubTopic: General Tags:
Nov ’22
Reply to Pac File shExpMatch
var blackhole = "PROXY 255.255.255.0:3421"; if (typeof(navigator) != "undefined" && navigator.appVersion.indexOf("Mac") != -1) { blackhole = "PROXY 0.0.0.0:3421"; } var localproxy = normal; var bypass = normal; /////////////////////////////////////////////////////////////////////////////// var isActive = 1; function FindProxyForURL(url, host) { //DEBUG alert("checking: url=" + url); // Suggestion from Quinten Martens // Make everything lower case. // WARNING: all shExpMatch rules following MUST be lowercase! url = url.toLowerCase(); host = host.toLowerCase(); if (0 || shExpMatch(url, "*.pdf") ) { // deny this request return blackhole; } else { return normal; } } function _dnsDomainIs(host, domain) { if (host.length > domain.length) { return (host.substring(host.length - domain.length - 1) == "."+domain); } return (host == domain); }```
Topic: Safari & Web SubTopic: General Tags:
Nov ’22
Reply to Pac File shExpMatch
Thanks, I posted the code below. The server is a local black hole that is reachable. I know it works because this || _dnsDomainIs(host, "api.giphy.com") blocks giphy.com I want to block all incoming pdf's to our devices.
Topic: Safari & Web SubTopic: General Tags:
Nov ’22