Skip to content

Commit

Permalink
Close #37, #34, and upgrade xcode proj to 15.2 for Safari extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-public committed Jan 20, 2024
1 parent 8601297 commit ba34c10
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
33 changes: 22 additions & 11 deletions safari/recipe-filter/recipe-filter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
127D5E1925DCD88600D9149F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 127D5E1825DCD88600D9149F /* AppDelegate.swift */; };
127D5E1C25DCD88600D9149F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 127D5E1A25DCD88600D9149F /* Main.storyboard */; };
127D5E1E25DCD88600D9149F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 127D5E1D25DCD88600D9149F /* ViewController.swift */; };
127D5E2025DCD88600D9149F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 127D5E1F25DCD88600D9149F /* Assets.xcassets */; };
127D5E2725DCD88600D9149F /* recipe-filter Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 127D5E2625DCD88600D9149F /* recipe-filter Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
127D5E2725DCD88600D9149F /* recipe-filter Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 127D5E2625DCD88600D9149F /* recipe-filter Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
127D5E2C25DCD88600D9149F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 127D5E2B25DCD88600D9149F /* Cocoa.framework */; };
127D5E2F25DCD88600D9149F /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 127D5E2E25DCD88600D9149F /* SafariWebExtensionHandler.swift */; };
127D5E4125DCD88600D9149F /* css in Resources */ = {isa = PBXBuildFile; fileRef = 127D5E3C25DCD88600D9149F /* css */; };
Expand All @@ -32,15 +32,15 @@
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
127D5E3725DCD88600D9149F /* Embed App Extensions */ = {
127D5E3725DCD88600D9149F /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
127D5E2725DCD88600D9149F /* recipe-filter Extension.appex in Embed App Extensions */,
127D5E2725DCD88600D9149F /* recipe-filter Extension.appex in Embed Foundation Extensions */,
);
name = "Embed App Extensions";
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -158,7 +158,7 @@
127D5E1025DCD88600D9149F /* Sources */,
127D5E1125DCD88600D9149F /* Frameworks */,
127D5E1225DCD88600D9149F /* Resources */,
127D5E3725DCD88600D9149F /* Embed App Extensions */,
127D5E3725DCD88600D9149F /* Embed Foundation Extensions */,
);
buildRules = (
);
Expand Down Expand Up @@ -193,8 +193,9 @@
127D5E0C25DCD88600D9149F /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 1240;
LastUpgradeCheck = 1520;
TargetAttributes = {
127D5E1325DCD88600D9149F = {
CreatedOnToolsVersion = 12.4;
Expand Down Expand Up @@ -321,9 +322,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -382,9 +385,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -407,14 +412,15 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "recipe-filter Extension/recipe_filter_Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = WJTP6P8PU4;
INFOPLIST_FILE = "recipe-filter Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = "com.recipe-filter.Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -427,14 +433,15 @@
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "recipe-filter Extension/recipe_filter_Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = WJTP6P8PU4;
INFOPLIST_FILE = "recipe-filter Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = "com.recipe-filter.Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -449,15 +456,17 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "recipe-filter/recipe_filter.entitlements";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = WJTP6P8PU4;
INFOPLIST_FILE = "recipe-filter/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = "com.recipe-filter";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -471,15 +480,17 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "recipe-filter/recipe_filter.entitlements";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = WJTP6P8PU4;
INFOPLIST_FILE = "recipe-filter/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = "com.recipe-filter";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
4 changes: 2 additions & 2 deletions src/css/recipe_filter.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
background: white !important;
z-index: 999999999 !important;
box-shadow: rgba(0, 0, 0, 0.5) 0px 0px 0px 9999999px !important;
max-width: 700px !important;
max-width: 800px !important;
min-width: 340px !important;
display: none;
}
Expand All @@ -20,7 +20,7 @@
color: rgba(0, 0, 0, 0.8);
background: rgba(100, 200, 100, 0.2);
font-family: Helvetica, Arial, sans-serif;
font-size: 15px;
font-size: 16px;
font-weight: bold;
text-align: left;
border-bottom: 1px solid #eee;
Expand Down
13 changes: 12 additions & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ recipe_selectors = [
'.mv-recipe-card',
'div[itemtype="http://schema.org/Recipe"]',
'div[itemtype="https://schema.org/Recipe"]',
'div.recipediv',
]

const closeButton = document.createElement('button');
Expand Down Expand Up @@ -47,9 +48,10 @@ function showPopup(){
clone.id = '_rf_highlight';
// add some control buttons
clone.prepend(controls);
clone.style.transition = 'opacity 500ms';
clone.style.transition = 'opacity 500ms';
clone.style.display = 'block';
clone.style.opacity = 0;
clone.setAttribute('aria-live', 'assertive');

document.body.insertBefore(clone, document.body.firstChild);

Expand All @@ -69,6 +71,15 @@ function showPopup(){
};
document.addEventListener('mouseup', mouseUpHide);

// another listener that hides when escape is pressed
const escapeUpHide = function (e) {
if (e.key === 'Escape') {
hidePopup();
document.removeEventListener('keyup', escapeUpHide);
}
}
document.addEventListener('keyup', escapeUpHide)

window.setTimeout(() => {
// fade in
clone.style.opacity = 1;
Expand Down

0 comments on commit ba34c10

Please sign in to comment.