#164: tell browser window to make new tab

This commit is contained in:
Cameron Kaiser 2019-02-11 18:46:38 -08:00
parent ed14536472
commit df1d52fe76

View File

@ -134,6 +134,7 @@ typedef unsigned int NSUInteger;
// Gecko Scripting Dictionary // Gecko Scripting Dictionary
- (NSArray*)scriptTabs; - (NSArray*)scriptTabs;
- (void)insertInScriptTabs:(id)value;
- (GeckoTab*)selectedScriptTab; - (GeckoTab*)selectedScriptTab;
// Helper Methods // Helper Methods
@ -468,6 +469,7 @@ static GeckoScriptingRoot *sharedScriptingRoot = nil;
} }
- (void)insertObject:(NSObject*)object inScriptTabsAtIndex:(NSUInteger)index { - (void)insertObject:(NSObject*)object inScriptTabsAtIndex:(NSUInteger)index {
NS_WARNING("AppleScript: window insertObject:inScriptTabsAtIndex");
if (![object isKindOfClass:[GeckoTab class]]) { if (![object isKindOfClass:[GeckoTab class]]) {
return; return;
} }
@ -481,7 +483,13 @@ static GeckoScriptingRoot *sharedScriptingRoot = nil;
} }
} }
- (void)insertInScriptTabs:(id)value {
NS_WARNING("AppleScript: window insertInScriptTabs");
[self insertObject:value inScriptTabsAtIndex:[[self scriptTabs] count]];
}
- (void)removeObjectFromScriptTabsAtIndex:(NSUInteger)index { - (void)removeObjectFromScriptTabsAtIndex:(NSUInteger)index {
NS_WARNING("AppleScript: window removeObjectFromScriptTabsAtIndex");
NSArray *tabs = [self scriptTabs]; NSArray *tabs = [self scriptTabs];
if (tabs && index < [tabs count]) { if (tabs && index < [tabs count]) {
NSCloseCommand *closeCommend = [[[NSCloseCommand alloc] init] autorelease]; NSCloseCommand *closeCommend = [[[NSCloseCommand alloc] init] autorelease];