Skip to content

Commit

Permalink
feat: add ffz support
Browse files Browse the repository at this point in the history
The extension now injects the FrankerFaceZ script as well + some image updates
  • Loading branch information
strumswell committed Aug 16, 2022
1 parent ed02e41 commit 8665668
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 23 deletions.
22 changes: 13 additions & 9 deletions BTTV for Safari.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1310;
LastUpgradeCheck = 1310;
LastUpgradeCheck = 1320;
TargetAttributes = {
25B81AF827689AF200B6717E = {
CreatedOnToolsVersion = 13.1;
Expand Down Expand Up @@ -432,8 +432,9 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "macOS (Extension)/BTTV for Safari.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = N6J2M765XY;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -446,7 +447,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand All @@ -464,8 +465,9 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "macOS (Extension)/BTTV for Safari.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = N6J2M765XY;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -478,7 +480,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand All @@ -500,8 +502,9 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "macOS (App)/BTTV for Safari.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = N6J2M765XY;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -514,7 +517,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand All @@ -537,8 +540,9 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "macOS (App)/BTTV for Safari.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = N6J2M765XY;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -551,7 +555,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
Expand Down
Empty file.
Binary file added Icon-App-1024x1024/icon.iconset/icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon-App-1024x1024/icon.iconset/icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon-App-1024x1024/icon.iconset/icon_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon-App-1024x1024/icon.iconset/icon_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon-App-1024x1024/icon.iconset/icon_32x32@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon-App-1024x1024/icon.iconset/icon_512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions Shared (App)/Base.lproj/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
<script src="../Script.js" defer></script>
</head>
<body>
<img src="../512.png" width="128" height="128" alt="BTTV for Safari Icon">
<p class="platform-mac state-unknown">You can turn on BTTV for Safari’s extension in Safari Extensions preferences.</p>
<img src="../512.png" width="64" height="64" alt="BTTV for Safari Icon">
<p class="platform-mac state-unknown">You can turn on BTTV for Safari’s extension in Safari Extensions preferences. Follow these steps:</p>
<ol class="list">
<li>Go to extensions settings in Safari
<li>Enable BTTV for Safari by ticking the checkmark
<li>In Safari settings, click on Websites
<li>Scroll down to BTTV for Twitch and check allow for Twitch
</ol>
<p class="platform-mac state-on">BTTV for Safari’s extension is currently on. You can turn it off in Safari Extensions preferences.</p>
<p class="platform-mac state-off">BTTV for Safari’s extension is currently off. You can turn it on in Safari Extensions preferences.</p>
<button class="platform-mac open-preferences">Quit and Open Safari Extensions Preferences…</button>
Expand Down
4 changes: 4 additions & 0 deletions Shared (App)/Resources/Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ body.state-off :is(.state-on, .state-unknown) {
display: none;
}

.list {
text-align: left;
}

button {
font-size: 1em;
}
6 changes: 3 additions & 3 deletions Shared (Extension)/Resources/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extension_name": {
"message": "BTTV for Safari",
"description": "The display name for the extension."
"description": "BTTV for Safari"
},
"extension_description": {
"message": "BTTV and FFZ emotes for Safari. This project is not affiliated with neither BTTV for FFZ.",
"description": "Description of what the extension does."
"message": "BTTV and FFZ emotes for Safari. This project is not affiliated with neither BTTV or FFZ.",
"description": "BTTV for Safari"
}
}
17 changes: 12 additions & 5 deletions Shared (Extension)/Resources/content.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
// Inject BBTV Script
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.betterttv.net/betterttv.js';
const head = document.getElementsByTagName('head')[0];
head.appendChild(script);
const bttvScript = document.createElement('script');
bttvScript.type = 'text/javascript';
bttvScript.src = 'https://cdn.betterttv.net/betterttv.js';

// Inject FFZ script
const ffzScript = document.createElement('script');
ffzScript.type = 'text/javascript';
ffzScript.src = 'https://cdn.frankerfacez.com/static/ffz_injector.user.js';

// Append scripts to head
const head = document.getElementsByTagName('head')[0];
head.appendChild(bttvScript);
head.appendChild(ffzScript);
2 changes: 2 additions & 0 deletions macOS (App)/BTTV for Safari.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
12 changes: 8 additions & 4 deletions macOS (Extension)/BTTV for Safari.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>

0 comments on commit 8665668

Please # to comment.