From 5e6de8b820e343cb8ca4fa8635445447aa36b54f Mon Sep 17 00:00:00 2001 From: tracer Date: Sat, 13 Mar 2021 14:00:27 +0100 Subject: [PATCH] Initial Commit --- .../Binnen_I_be_gone_Extension.entitlements | 10 + Binnen-I be gone Extension/Info.plist | 33 ++ .../SafariWebExtensionHandler.swift | 26 + Binnen-I be gone.xcodeproj/project.pbxproj | 530 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/xcschememanagement.plist | 14 + Binnen-I be gone/AppDelegate.swift | 25 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 59 ++ .../AppIcon.appiconset/icon128.png | Bin 0 -> 2904 bytes .../Assets.xcassets/Contents.json | 6 + Binnen-I be gone/Base.lproj/Main.storyboard | 167 ++++++ .../Binnen_I_be_gone.entitlements | 10 + Binnen-I be gone/Info.plist | 30 + Binnen-I be gone/ViewController.swift | 51 ++ 16 files changed, 987 insertions(+) create mode 100644 Binnen-I be gone Extension/Binnen_I_be_gone_Extension.entitlements create mode 100644 Binnen-I be gone Extension/Info.plist create mode 100644 Binnen-I be gone Extension/SafariWebExtensionHandler.swift create mode 100644 Binnen-I be gone.xcodeproj/project.pbxproj create mode 100644 Binnen-I be gone.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Binnen-I be gone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Binnen-I be gone.xcodeproj/xcuserdata/tracer.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Binnen-I be gone/AppDelegate.swift create mode 100644 Binnen-I be gone/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/icon128.png create mode 100644 Binnen-I be gone/Assets.xcassets/Contents.json create mode 100644 Binnen-I be gone/Base.lproj/Main.storyboard create mode 100644 Binnen-I be gone/Binnen_I_be_gone.entitlements create mode 100644 Binnen-I be gone/Info.plist create mode 100644 Binnen-I be gone/ViewController.swift diff --git a/Binnen-I be gone Extension/Binnen_I_be_gone_Extension.entitlements b/Binnen-I be gone Extension/Binnen_I_be_gone_Extension.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/Binnen-I be gone Extension/Binnen_I_be_gone_Extension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/Binnen-I be gone Extension/Info.plist b/Binnen-I be gone Extension/Info.plist new file mode 100644 index 0000000..f2effc6 --- /dev/null +++ b/Binnen-I be gone Extension/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Binnen-I be gone Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSExtension + + NSExtensionPointIdentifier + com.apple.Safari.web-extension + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).SafariWebExtensionHandler + + + diff --git a/Binnen-I be gone Extension/SafariWebExtensionHandler.swift b/Binnen-I be gone Extension/SafariWebExtensionHandler.swift new file mode 100644 index 0000000..69851cb --- /dev/null +++ b/Binnen-I be gone Extension/SafariWebExtensionHandler.swift @@ -0,0 +1,26 @@ +// +// SafariWebExtensionHandler.swift +// Binnen-I be gone Extension +// +// Created by tracer on 13.03.21. +// + +import SafariServices +import os.log + +let SFExtensionMessageKey = "message" + +class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { + + func beginRequest(with context: NSExtensionContext) { + let item = context.inputItems[0] as! NSExtensionItem + let message = item.userInfo?[SFExtensionMessageKey] + os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@", message as! CVarArg) + + let response = NSExtensionItem() + response.userInfo = [ SFExtensionMessageKey: [ "Response to": message ] ] + + context.completeRequest(returningItems: [response], completionHandler: nil) + } + +} diff --git a/Binnen-I be gone.xcodeproj/project.pbxproj b/Binnen-I be gone.xcodeproj/project.pbxproj new file mode 100644 index 0000000..811b469 --- /dev/null +++ b/Binnen-I be gone.xcodeproj/project.pbxproj @@ -0,0 +1,530 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 521FE88025FCDBE3000B70EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 521FE87F25FCDBE3000B70EB /* AppDelegate.swift */; }; + 521FE88325FCDBE3000B70EB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 521FE88125FCDBE3000B70EB /* Main.storyboard */; }; + 521FE88525FCDBE3000B70EB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 521FE88425FCDBE3000B70EB /* ViewController.swift */; }; + 521FE88725FCDBE4000B70EB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 521FE88625FCDBE4000B70EB /* Assets.xcassets */; }; + 521FE88E25FCDBE4000B70EB /* Binnen-I be gone Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 521FE88D25FCDBE4000B70EB /* Binnen-I be gone Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 521FE89325FCDBE4000B70EB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 521FE89225FCDBE4000B70EB /* Cocoa.framework */; }; + 521FE89625FCDBE4000B70EB /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 521FE89525FCDBE4000B70EB /* SafariWebExtensionHandler.swift */; }; + 521FE8AB25FCDBE4000B70EB /* background.js in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A325FCDBE4000B70EB /* background.js */; }; + 521FE8AC25FCDBE4000B70EB /* css in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A425FCDBE4000B70EB /* css */; }; + 521FE8AD25FCDBE4000B70EB /* images in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A525FCDBE4000B70EB /* images */; }; + 521FE8AE25FCDBE4000B70EB /* options.js in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A625FCDBE4000B70EB /* options.js */; }; + 521FE8AF25FCDBE4000B70EB /* _metadata in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A725FCDBE4000B70EB /* _metadata */; }; + 521FE8B025FCDBE4000B70EB /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A825FCDBE4000B70EB /* manifest.json */; }; + 521FE8B125FCDBE4000B70EB /* options.html in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8A925FCDBE4000B70EB /* options.html */; }; + 521FE8B225FCDBE4000B70EB /* binnenibegone.js in Resources */ = {isa = PBXBuildFile; fileRef = 521FE8AA25FCDBE4000B70EB /* binnenibegone.js */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 521FE88F25FCDBE4000B70EB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 521FE87325FCDBE3000B70EB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 521FE88C25FCDBE4000B70EB; + remoteInfo = "Binnen-I be gone Extension"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 521FE89E25FCDBE4000B70EB /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 521FE88E25FCDBE4000B70EB /* Binnen-I be gone Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 521FE87B25FCDBE3000B70EB /* Binnen-I be gone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Binnen-I be gone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 521FE87E25FCDBE3000B70EB /* Binnen_I_be_gone.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Binnen_I_be_gone.entitlements; sourceTree = ""; }; + 521FE87F25FCDBE3000B70EB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 521FE88225FCDBE3000B70EB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 521FE88425FCDBE3000B70EB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 521FE88625FCDBE4000B70EB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 521FE88825FCDBE4000B70EB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 521FE88D25FCDBE4000B70EB /* Binnen-I be gone Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Binnen-I be gone Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 521FE89225FCDBE4000B70EB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 521FE89525FCDBE4000B70EB /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = ""; }; + 521FE89725FCDBE4000B70EB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 521FE89825FCDBE4000B70EB /* Binnen_I_be_gone_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Binnen_I_be_gone_Extension.entitlements; sourceTree = ""; }; + 521FE8A325FCDBE4000B70EB /* background.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = background.js; path = ../../chrome/2.7_0/background.js; sourceTree = ""; }; + 521FE8A425FCDBE4000B70EB /* css */ = {isa = PBXFileReference; lastKnownFileType = folder; name = css; path = ../../chrome/2.7_0/css; sourceTree = ""; }; + 521FE8A525FCDBE4000B70EB /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; name = images; path = ../../chrome/2.7_0/images; sourceTree = ""; }; + 521FE8A625FCDBE4000B70EB /* options.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = options.js; path = ../../chrome/2.7_0/options.js; sourceTree = ""; }; + 521FE8A725FCDBE4000B70EB /* _metadata */ = {isa = PBXFileReference; lastKnownFileType = folder; name = _metadata; path = ../../chrome/2.7_0/_metadata; sourceTree = ""; }; + 521FE8A825FCDBE4000B70EB /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = manifest.json; path = ../../chrome/2.7_0/manifest.json; sourceTree = ""; }; + 521FE8A925FCDBE4000B70EB /* options.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = options.html; path = ../../chrome/2.7_0/options.html; sourceTree = ""; }; + 521FE8AA25FCDBE4000B70EB /* binnenibegone.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = binnenibegone.js; path = ../../chrome/2.7_0/binnenibegone.js; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 521FE87825FCDBE3000B70EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 521FE88A25FCDBE4000B70EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 521FE89325FCDBE4000B70EB /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 521FE87225FCDBE3000B70EB = { + isa = PBXGroup; + children = ( + 521FE87D25FCDBE3000B70EB /* Binnen-I be gone */, + 521FE89425FCDBE4000B70EB /* Binnen-I be gone Extension */, + 521FE89125FCDBE4000B70EB /* Frameworks */, + 521FE87C25FCDBE3000B70EB /* Products */, + ); + sourceTree = ""; + }; + 521FE87C25FCDBE3000B70EB /* Products */ = { + isa = PBXGroup; + children = ( + 521FE87B25FCDBE3000B70EB /* Binnen-I be gone.app */, + 521FE88D25FCDBE4000B70EB /* Binnen-I be gone Extension.appex */, + ); + name = Products; + sourceTree = ""; + }; + 521FE87D25FCDBE3000B70EB /* Binnen-I be gone */ = { + isa = PBXGroup; + children = ( + 521FE87E25FCDBE3000B70EB /* Binnen_I_be_gone.entitlements */, + 521FE87F25FCDBE3000B70EB /* AppDelegate.swift */, + 521FE88125FCDBE3000B70EB /* Main.storyboard */, + 521FE88425FCDBE3000B70EB /* ViewController.swift */, + 521FE88625FCDBE4000B70EB /* Assets.xcassets */, + 521FE88825FCDBE4000B70EB /* Info.plist */, + ); + path = "Binnen-I be gone"; + sourceTree = ""; + }; + 521FE89125FCDBE4000B70EB /* Frameworks */ = { + isa = PBXGroup; + children = ( + 521FE89225FCDBE4000B70EB /* Cocoa.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 521FE89425FCDBE4000B70EB /* Binnen-I be gone Extension */ = { + isa = PBXGroup; + children = ( + 521FE8A225FCDBE4000B70EB /* Resources */, + 521FE89525FCDBE4000B70EB /* SafariWebExtensionHandler.swift */, + 521FE89725FCDBE4000B70EB /* Info.plist */, + 521FE89825FCDBE4000B70EB /* Binnen_I_be_gone_Extension.entitlements */, + ); + path = "Binnen-I be gone Extension"; + sourceTree = ""; + }; + 521FE8A225FCDBE4000B70EB /* Resources */ = { + isa = PBXGroup; + children = ( + 521FE8A325FCDBE4000B70EB /* background.js */, + 521FE8A425FCDBE4000B70EB /* css */, + 521FE8A525FCDBE4000B70EB /* images */, + 521FE8A625FCDBE4000B70EB /* options.js */, + 521FE8A725FCDBE4000B70EB /* _metadata */, + 521FE8A825FCDBE4000B70EB /* manifest.json */, + 521FE8A925FCDBE4000B70EB /* options.html */, + 521FE8AA25FCDBE4000B70EB /* binnenibegone.js */, + ); + name = Resources; + path = "Binnen-I be gone Extension"; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 521FE87A25FCDBE3000B70EB /* Binnen-I be gone */ = { + isa = PBXNativeTarget; + buildConfigurationList = 521FE89F25FCDBE4000B70EB /* Build configuration list for PBXNativeTarget "Binnen-I be gone" */; + buildPhases = ( + 521FE87725FCDBE3000B70EB /* Sources */, + 521FE87825FCDBE3000B70EB /* Frameworks */, + 521FE87925FCDBE3000B70EB /* Resources */, + 521FE89E25FCDBE4000B70EB /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 521FE89025FCDBE4000B70EB /* PBXTargetDependency */, + ); + name = "Binnen-I be gone"; + productName = "Binnen-I be gone"; + productReference = 521FE87B25FCDBE3000B70EB /* Binnen-I be gone.app */; + productType = "com.apple.product-type.application"; + }; + 521FE88C25FCDBE4000B70EB /* Binnen-I be gone Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 521FE89B25FCDBE4000B70EB /* Build configuration list for PBXNativeTarget "Binnen-I be gone Extension" */; + buildPhases = ( + 521FE88925FCDBE4000B70EB /* Sources */, + 521FE88A25FCDBE4000B70EB /* Frameworks */, + 521FE88B25FCDBE4000B70EB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Binnen-I be gone Extension"; + productName = "Binnen-I be gone Extension"; + productReference = 521FE88D25FCDBE4000B70EB /* Binnen-I be gone Extension.appex */; + productType = "com.apple.product-type.app-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 521FE87325FCDBE3000B70EB /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1240; + LastUpgradeCheck = 1240; + TargetAttributes = { + 521FE87A25FCDBE3000B70EB = { + CreatedOnToolsVersion = 12.4; + }; + 521FE88C25FCDBE4000B70EB = { + CreatedOnToolsVersion = 12.4; + }; + }; + }; + buildConfigurationList = 521FE87625FCDBE3000B70EB /* Build configuration list for PBXProject "Binnen-I be gone" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 521FE87225FCDBE3000B70EB; + productRefGroup = 521FE87C25FCDBE3000B70EB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 521FE87A25FCDBE3000B70EB /* Binnen-I be gone */, + 521FE88C25FCDBE4000B70EB /* Binnen-I be gone Extension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 521FE87925FCDBE3000B70EB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 521FE88725FCDBE4000B70EB /* Assets.xcassets in Resources */, + 521FE88325FCDBE3000B70EB /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 521FE88B25FCDBE4000B70EB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 521FE8B125FCDBE4000B70EB /* options.html in Resources */, + 521FE8AD25FCDBE4000B70EB /* images in Resources */, + 521FE8AE25FCDBE4000B70EB /* options.js in Resources */, + 521FE8AC25FCDBE4000B70EB /* css in Resources */, + 521FE8AF25FCDBE4000B70EB /* _metadata in Resources */, + 521FE8B025FCDBE4000B70EB /* manifest.json in Resources */, + 521FE8B225FCDBE4000B70EB /* binnenibegone.js in Resources */, + 521FE8AB25FCDBE4000B70EB /* background.js in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 521FE87725FCDBE3000B70EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 521FE88525FCDBE3000B70EB /* ViewController.swift in Sources */, + 521FE88025FCDBE3000B70EB /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 521FE88925FCDBE4000B70EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 521FE89625FCDBE4000B70EB /* SafariWebExtensionHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 521FE89025FCDBE4000B70EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 521FE88C25FCDBE4000B70EB /* Binnen-I be gone Extension */; + targetProxy = 521FE88F25FCDBE4000B70EB /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 521FE88125FCDBE3000B70EB /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 521FE88225FCDBE3000B70EB /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 521FE89925FCDBE4000B70EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 11.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 521FE89A25FCDBE4000B70EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 11.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 521FE89C25FCDBE4000B70EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "Binnen-I be gone Extension/Binnen_I_be_gone_Extension.entitlements"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Binnen-I be gone Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + PRODUCT_BUNDLE_IDENTIFIER = "net.24unix.Binnen-I-be-gone.Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 521FE89D25FCDBE4000B70EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "Binnen-I be gone Extension/Binnen_I_be_gone_Extension.entitlements"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Binnen-I be gone Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + PRODUCT_BUNDLE_IDENTIFIER = "net.24unix.Binnen-I-be-gone.Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 521FE8A025FCDBE4000B70EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "Binnen-I be gone/Binnen_I_be_gone.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "Binnen-I be gone/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + PRODUCT_BUNDLE_IDENTIFIER = "net.24unix.Binnen-I-be-gone"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 521FE8A125FCDBE4000B70EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "Binnen-I be gone/Binnen_I_be_gone.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "Binnen-I be gone/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + PRODUCT_BUNDLE_IDENTIFIER = "net.24unix.Binnen-I-be-gone"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 521FE87625FCDBE3000B70EB /* Build configuration list for PBXProject "Binnen-I be gone" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 521FE89925FCDBE4000B70EB /* Debug */, + 521FE89A25FCDBE4000B70EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 521FE89B25FCDBE4000B70EB /* Build configuration list for PBXNativeTarget "Binnen-I be gone Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 521FE89C25FCDBE4000B70EB /* Debug */, + 521FE89D25FCDBE4000B70EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 521FE89F25FCDBE4000B70EB /* Build configuration list for PBXNativeTarget "Binnen-I be gone" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 521FE8A025FCDBE4000B70EB /* Debug */, + 521FE8A125FCDBE4000B70EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 521FE87325FCDBE3000B70EB /* Project object */; +} diff --git a/Binnen-I be gone.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Binnen-I be gone.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Binnen-I be gone.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Binnen-I be gone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Binnen-I be gone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Binnen-I be gone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Binnen-I be gone.xcodeproj/xcuserdata/tracer.xcuserdatad/xcschemes/xcschememanagement.plist b/Binnen-I be gone.xcodeproj/xcuserdata/tracer.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c0ac6b7 --- /dev/null +++ b/Binnen-I be gone.xcodeproj/xcuserdata/tracer.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Binnen-I be gone.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Binnen-I be gone/AppDelegate.swift b/Binnen-I be gone/AppDelegate.swift new file mode 100644 index 0000000..eccab4d --- /dev/null +++ b/Binnen-I be gone/AppDelegate.swift @@ -0,0 +1,25 @@ +// +// AppDelegate.swift +// Binnen-I be gone +// +// Created by tracer on 13.03.21. +// + +import Cocoa + +@main +class AppDelegate: NSObject, NSApplicationDelegate { + + func applicationDidFinishLaunching(_ notification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ notification: Notification) { + // Insert code here to tear down your application + } + + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + +} diff --git a/Binnen-I be gone/Assets.xcassets/AccentColor.colorset/Contents.json b/Binnen-I be gone/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Binnen-I be gone/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/Contents.json b/Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..f54082c --- /dev/null +++ b/Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,59 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon128.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/icon128.png b/Binnen-I be gone/Assets.xcassets/AppIcon.appiconset/icon128.png new file mode 100644 index 0000000000000000000000000000000000000000..7e23cf0e599bfda4a2a1e958b35c55d6e6d5f212 GIT binary patch literal 2904 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 literal 0 HcmV?d00001 diff --git a/Binnen-I be gone/Assets.xcassets/Contents.json b/Binnen-I be gone/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Binnen-I be gone/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Binnen-I be gone/Base.lproj/Main.storyboard b/Binnen-I be gone/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8af36fb --- /dev/null +++ b/Binnen-I be gone/Base.lproj/Main.storyboard @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Binnen-I be gone/Binnen_I_be_gone.entitlements b/Binnen-I be gone/Binnen_I_be_gone.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/Binnen-I be gone/Binnen_I_be_gone.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/Binnen-I be gone/Info.plist b/Binnen-I be gone/Info.plist new file mode 100644 index 0000000..cfbbdb7 --- /dev/null +++ b/Binnen-I be gone/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + diff --git a/Binnen-I be gone/ViewController.swift b/Binnen-I be gone/ViewController.swift new file mode 100644 index 0000000..57c7150 --- /dev/null +++ b/Binnen-I be gone/ViewController.swift @@ -0,0 +1,51 @@ +// +// ViewController.swift +// Binnen-I be gone +// +// Created by tracer on 13.03.21. +// + +import Cocoa +import SafariServices.SFSafariApplication +import SafariServices.SFSafariExtensionManager + +let appName = "Binnen-I be gone" +let extensionBundleIdentifier = "net.24unix.Binnen-I-be-gone.Extension" + +class ViewController: NSViewController { + + @IBOutlet var appNameLabel: NSTextField! + + override func viewDidLoad() { + super.viewDidLoad() + self.appNameLabel.stringValue = appName + SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: extensionBundleIdentifier) { (state, error) in + guard let state = state, error == nil else { + // Insert code to inform the user that something went wrong. + return + } + + DispatchQueue.main.async { + if (state.isEnabled) { + self.appNameLabel.stringValue = "\(appName)'s extension is currently on." + } else { + self.appNameLabel.stringValue = "\(appName)'s extension is currently off. You can turn it on in Safari Extensions preferences." + } + } + } + } + + @IBAction func openSafariExtensionPreferences(_ sender: AnyObject?) { + SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in + guard error == nil else { + // Insert code to inform the user that something went wrong. + return + } + + DispatchQueue.main.async { + NSApplication.shared.terminate(nil) + } + } + } + +}