You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AdGuard can't filter PWA due to the way PWAsForFirefox generates the executable for the PWA application.
Proposed Solution
The most preferred way is to replace the script with a real executable binary file.
This is a simple example source code for an executable.
import Foundation
let exePath = ProcessInfo.processInfo.environment["exePath"]!
let pwaId = ProcessInfo.processInfo.environment["pwaId"]!
let task = Process()
task.launchPath = exePath
task.arguments = ["site", "launch", "--direct-launch", pwaId, "\"$@\""]
task.launch()
task.waitUntilExit()
In order for the updated environment to be detected by the process, it is necessary to make changes to the info.plist file by adding the following lines there.
I tested this solution, it works fine.
The executable file was compiled using swiftc, after that I replaced the original executable with my executable and modified the info.plist file.
The text was updated successfully, but these errors were encountered:
I'm pretty late because I didn't have much time. Anyway, I tried doing this but it doesn't work for me. It appears the executable does not see variables set in LSEnvironment, so the app cannot start.
Apparently LSEnvironment by processes started via "Launch Services" and not via terminal (source?). However, it also does not work for me when I try to launch it from Launchpad. Maybe it's because I'm using the old macOS 10.15.7 (the latest I could install into VM)? But in any case, I would like if launching from the terminal (using firefoxpwa site launch and open) would also work.
Is there any more reliable way of setting environment variables for a bundle? Or, is swiftc included in standard macOS out-of-the-box? This isn't the nicest solution, but maybe PWAsForFirefox could compile a new executable when installing each PWA and include exePath and pwaId directly in the source code.
Edit: I think swiftc is not included in macOS by default, but it's included in Command Line Tools for Xcode. However, considering Homebrew requires and installs Command Line Tools, I can probably assume users will have it installed. So, unless I find a way to properly set environment variables, I will just compile loader executable and installing PWA.
Problem Description
AdGuard can't filter PWA due to the way PWAsForFirefox generates the executable for the PWA application.
Proposed Solution
The most preferred way is to replace the script with a real executable binary file.
This is a simple example source code for an executable.
In order for the updated environment to be detected by the process, it is necessary to make changes to the info.plist file by adding the following lines there.
Additional Information
I tested this solution, it works fine.
The executable file was compiled using swiftc, after that I replaced the original executable with my executable and modified the info.plist file.
The text was updated successfully, but these errors were encountered: