Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

Commit 7c147db

Browse files
authored
Safari 14 support (#519)
* add more icons * add Xcode project * 🔥 * base Xcode project * 🔥 * add base Safari Xcode project * set version and category * 🔥 * 🔧 * 🔥 * 🔧 * ignore .xcuserstate * Update update_safari_files.js * 🔥 * 🔧 * 🔥 * 🔧 * shrug * Update .gitignore * 🔧 * 🔧 * 🔥 * remove old edge manifest * move output to dist/build * re-instate safari project * prevent options pane being hidden by adblockers * fix options after buildtool change * add toolbar icons * rename app * Update package.json * 🔧 * ignore build folder * add build step for safari * rename * disable sharing menu item on Safari
1 parent 493bd9a commit 7c147db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1179
-117
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
node_modules
33
safari
44
dist/
5+
build
56
artifacts/*
67
config/development.js
78
config/production.js
@@ -28,3 +29,6 @@ config/*.json
2829

2930
output/*
3031
res-webpack.config.js
32+
*.xcuserstate
33+
*.xcworkspacedata
34+
xcuserdata

package-lock.json

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"release": "npm run build:prod -- chrome && npm run pack:chrome && npm run build:prod -- firefox && npm run pack:firefox",
2424
"pack:chrome": "cross-env NODE_ENV=development node tools/pack.js",
2525
"pack:firefox": "cross-env NODE_ENV=development web-ext build -s dist -a artifacts",
26+
"pack:safari": "xcodebuild -project 'safari/Better TweetDeck for Safari/Better TweetDeck for Safari.xcodeproj/'",
2627
"update_emojis": "node tools/update_emojis.js",
2728
"prepush": "npm run lint",
28-
"bump-version": "node tools/bumpVersion.js",
2929
"fix": "eslint --fix '**/*.{js,jsx}' && prettier --write '**/*.css'"
3030
},
3131
"homepage": "https://github.com/eramdam/BetterTweetDeck",
@@ -72,12 +72,14 @@
7272
"reuse-promise": "^2.0.0",
7373
"rimraf": "^2.6.2",
7474
"semver": "^5.6.0",
75+
"simple-plist": "^1.1.1",
7576
"stringify-package": "^1.0.0",
7677
"style-loader": "^0.20.3",
7778
"web-ext": "^4.2.0",
7879
"webpack": "^4.5.0",
7980
"webpack-bundle-analyzer": "^3.3.2",
8081
"webpack-cli": "^3.3.10",
82+
"xcode": "^3.0.1",
8183
"xml-js": "^1.6.2",
8284
"zip-webpack-plugin": "^3.0.0"
8385
},
@@ -95,4 +97,4 @@
9597
"stylelint-config-standard": "^18.2.0",
9698
"ws": "^5.1.1"
9799
}
98-
}
100+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-only</key>
8+
<true/>
9+
</dict>
10+
</plist>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>Better TweetDeck for Safari Extension</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>$(MARKETING_VERSION)</string>
21+
<key>CFBundleVersion</key>
22+
<string>3916</string>
23+
<key>LSMinimumSystemVersion</key>
24+
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
25+
<key>NSExtension</key>
26+
<dict>
27+
<key>NSExtensionPointIdentifier</key>
28+
<string>com.apple.Safari.web-extension</string>
29+
<key>NSExtensionPrincipalClass</key>
30+
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
31+
</dict>
32+
</dict>
33+
</plist>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// SafariWebExtensionHandler.swift
3+
// Better TweetDeck for Safari Extension
4+
//
5+
// Created by Damien Erambert on 1/16/21.
6+
//
7+
8+
import SafariServices
9+
import os.log
10+
11+
let SFExtensionMessageKey = "message"
12+
13+
class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
14+
15+
func beginRequest(with context: NSExtensionContext) {
16+
let item = context.inputItems[0] as! NSExtensionItem
17+
let message = item.userInfo?[SFExtensionMessageKey]
18+
os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@", message as! CVarArg)
19+
20+
let response = NSExtensionItem()
21+
response.userInfo = [ SFExtensionMessageKey: [ "Response to": message ] ]
22+
23+
context.completeRequest(returningItems: [response], completionHandler: nil)
24+
}
25+
26+
}

0 commit comments

Comments
 (0)