Skip to content

Commit

Permalink
1.89 (faster bookmark launching)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuusko5 committed May 2, 2020
1 parent d08678d commit 91fd4e3
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 567 deletions.
14 changes: 4 additions & 10 deletions Gestr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
D040287719CA591100E372E7 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D040287619CA591100E372E7 /* CoreServices.framework */; };
D040287919CA591500E372E7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D040287819CA591500E372E7 /* Carbon.framework */; };
D040287B19CA591900E372E7 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D040287A19CA591900E372E7 /* Cocoa.framework */; };
D040287D19CA597200E372E7 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D040287C19CA597200E372E7 /* ScriptingBridge.framework */; };
D05227061A33BBEE00AAF6FD /* NSImage+M5Darkable.m in Sources */ = {isa = PBXBuildFile; fileRef = D05227051A33BBEE00AAF6FD /* NSImage+M5Darkable.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -98,7 +97,6 @@
0029FDAB18557DE600BDBA25 /* AppTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppTextFieldCell.h; sourceTree = "<group>"; };
0029FDAC18557DE600BDBA25 /* AppTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppTextFieldCell.m; sourceTree = "<group>"; };
0029FDAE18557DE600BDBA25 /* background2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background2.png; sourceTree = "<group>"; };
0029FDAF18557DE600BDBA25 /* Chrome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chrome.h; sourceTree = "<group>"; };
0029FDB018557DE600BDBA25 /* ChromePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChromePage.h; sourceTree = "<group>"; };
0029FDB118557DE600BDBA25 /* ChromePage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChromePage.m; sourceTree = "<group>"; };
0029FDB218557DE600BDBA25 /* Gestr-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Gestr-Info.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -156,7 +154,6 @@
0029FDE618557DE600BDBA25 /* NSStatusItemPrioritizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSStatusItemPrioritizer.m; sourceTree = "<group>"; };
0029FDE718557DE600BDBA25 /* RepeatedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RepeatedImageView.h; sourceTree = "<group>"; };
0029FDE818557DE600BDBA25 /* RepeatedImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RepeatedImageView.m; sourceTree = "<group>"; };
0029FDE918557DE600BDBA25 /* Safari.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Safari.h; sourceTree = "<group>"; };
0029FDEA18557DE600BDBA25 /* SafariPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SafariPage.h; sourceTree = "<group>"; };
0029FDEB18557DE600BDBA25 /* SafariPage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SafariPage.m; sourceTree = "<group>"; };
0029FDEC18557DE600BDBA25 /* ShadowTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowTextFieldCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -190,7 +187,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D040287D19CA597200E372E7 /* ScriptingBridge.framework in Frameworks */,
D040287B19CA591900E372E7 /* Cocoa.framework in Frameworks */,
D040287919CA591500E372E7 /* Carbon.framework in Frameworks */,
D040287719CA591100E372E7 /* CoreServices.framework in Frameworks */,
Expand Down Expand Up @@ -258,8 +254,6 @@
isa = PBXGroup;
children = (
0037430F1885E30600F9B53A /* Images.xcassets */,
0029FDAF18557DE600BDBA25 /* Chrome.h */,
0029FDE918557DE600BDBA25 /* Safari.h */,
0029FDEF18557DE600BDBA25 /* tableCellBack.png */,
0029FDF018557DE600BDBA25 /* trackpadBackground.png */,
0029FDB218557DE600BDBA25 /* Gestr-Info.plist */,
Expand Down Expand Up @@ -637,7 +631,7 @@
CODE_SIGN_ENTITLEMENTS = Gestr/Gestr.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.88;
CURRENT_PROJECT_VERSION = 1.89;
DEVELOPMENT_TEAM = EGQME33F5E;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -648,7 +642,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Gestr/Gestr-Prefix.pch";
INFOPLIST_FILE = "Gestr/Gestr-Info.plist";
MARKETING_VERSION = 1.88;
MARKETING_VERSION = 1.89;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = "com.mhuusko5.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Gestr;
Expand All @@ -665,7 +659,7 @@
CODE_SIGN_ENTITLEMENTS = Gestr/Gestr.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.88;
CURRENT_PROJECT_VERSION = 1.89;
DEVELOPMENT_TEAM = EGQME33F5E;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -676,7 +670,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Gestr/Gestr-Prefix.pch";
INFOPLIST_FILE = "Gestr/Gestr-Info.plist";
MARKETING_VERSION = 1.88;
MARKETING_VERSION = 1.89;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = "com.mhuusko5.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Gestr;
Expand Down
190 changes: 0 additions & 190 deletions Gestr/Chrome.h

This file was deleted.

3 changes: 0 additions & 3 deletions Gestr/ChromePage.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#import <ScriptingBridge/ScriptingBridge.h>
#import "Chrome.h"
#import "WebPage.h"

@interface ChromePage : WebPage

- (id)initWithDisplayName:(NSString *)displayName icon:(NSImage *)icon url:(NSString *)url;
- (void)launch;

@end
43 changes: 1 addition & 42 deletions Gestr/ChromePage.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,7 @@
@implementation ChromePage

- (id)initWithDisplayName:(NSString *)displayName icon:(NSImage *)icon url:(NSString *)url {
self = [super initWithDisplayName:displayName icon:icon url:url targetBrowserId:@"com.google.Chrome"];

return self;
}

- (void)launch {
ChromeApplication *chrome = [SBApplication applicationWithBundleIdentifier:@"com.google.Chrome"];
[chrome activate];

if (chrome.windows.count == 0) {
[chrome.windows addObject:[[[chrome classForScriptingClass:@"window"] alloc] init]];
((ChromeWindow *)chrome.windows[0]).activeTab.URL = self.url;
}
else {
BOOL tabExists = NO;
int tabIndex = -1;
ChromeWindow *window = nil;
for (window in chrome.windows) {
for (int i = 0; i < window.tabs.count; i++) {
ChromeTab *tab = window.tabs[i];
if ([[[self class] stripUrl:tab.URL] isEqualToString:[[self class] stripUrl:self.url]]) {
tabIndex = i;
tabExists = YES;
break;
}
}
if (tabExists) {
break;
}
}

if (tabExists) {
window.activeTabIndex = tabIndex + 1;
window.index = 1;
}
else {
ChromeTab *newTab = [[[chrome classForScriptingClass:@"tab"] alloc] initWithProperties:@{ @"URL": self.url }];
window = chrome.windows[0];
[window.tabs addObject:newTab];
window.index = 1;
}
}
return (self = [super initWithDisplayName:displayName icon:icon url:url targetBrowserId:@"com.google.Chrome"]);
}

@end
Loading

0 comments on commit 91fd4e3

Please sign in to comment.