Skip to content

Instantly share code, notes, and snippets.

@bsramin
Created May 1, 2020 18:21
Show Gist options
  • Save bsramin/650d3a189a24d78cfec4d5fd703d68b8 to your computer and use it in GitHub Desktop.
Save bsramin/650d3a189a24d78cfec4d5fd703d68b8 to your computer and use it in GitHub Desktop.
Fix issue for ferdi user agent (for google services)
#!/bin/bash
# Fixes broken Google-based Franz recipes by changing user-agent per recipe
# "This browser or app may not be secure. Learn more. Try using a different browser"
FRANZ_OR_FERDI=Ferdi
MAC_OSX_PATH="$HOME/Library/Application Support/$FRANZ_OR_FERDI/recipes"
find "$MAC_OSX_PATH" -type d \( \
-name "hangouts" -o \
-name "hangoutschat" -o \
-name "gmail" -o \
-name "googlecalendar" -o \
-name "ex-google-voice" -o \
-name "googlekeep" \) \
-exec sh -c 'echo "module.exports = Franz =>\n class F extends Franz {\n overrideUserAgent() {\n return \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36\";\n }\n };\n" > "$1"/index.js' sh {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment