Skip to content

Commit 86a294c

Browse files
authored
Firefox addon (#314)
* update design properties with firefoxs calculated defaults * firefox bugfix: rect requires inline w/h to work..? * no plugins, no dynamic import todo: make a new rollup config and make a bigger bundle for firefox that has all the plugins loaded * polyfill not required, which is nice! * visbug element renders again * update lock * to be safe, find all and remove * new trick, inject on page not from extension * remove polyfill, remove bundle from content script * added web-ext to npm scripts * added firefox to postcss browserlist to fix some bugs like with system-ui * adds visbug bundle to web accessible resources * thanks kezzbracey for the suggestion to go attributes * remove opacity if backdrop filter isnt supported * fixes hover inspect * fixes margin and padding by removing typedOM usage * fixes hueshift * switch to less ambigious use of window * fixes plugins and datalist autocomplete * fixes safari search input styles * add safari project * adapt to platform * prep for updated version * safari build nits * resolves loading jank * puts a wrap on the safari build * update icons and nudge project details * fixes bug where extension button goes nowhere
1 parent f030412 commit 86a294c

Some content is hidden

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

46 files changed

+7869
-2040
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ extension/toolbar/bundle.min.js
77
extension/toolbar/bundle.css
88
extension/build
99
extension/tuts
10+
VisBug/VisBug.xcodeproj/project.xcworkspace/xcuserdata/argyle.xcuserdatad/UserInterfaceState.xcuserstate

Diff for: VisBug/VisBug Extension/Info.plist

+33
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>VisBug 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>$(CURRENT_PROJECT_VERSION)</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>
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// SafariWebExtensionHandler.swift
3+
// VisBug Extension
4+
//
5+
// Created by Adam Argyle on 11/2/20.
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+
}
+10
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>

0 commit comments

Comments
 (0)