mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-01-15 09:30:20 +00:00
#552: fix <<current tab>>
This commit is contained in:
parent
23f3034604
commit
aaa5809fd3
@ -942,7 +942,14 @@ BrowserGlue.prototype = {
|
||||
},
|
||||
getCurrentTabInWindow : function(index, tab_index) {
|
||||
let win = this.getWindow(index);
|
||||
return win.content;
|
||||
if (win != null) {
|
||||
let tab = win.content;
|
||||
if (tab != null) {
|
||||
tab_index.value = win.gBrowser.tabContainer.selectedIndex;
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
createTabAtIndexInWindow : function(index, window_index) {
|
||||
let win = this.getWindow(window_index);
|
||||
|
@ -578,6 +578,9 @@ static BOOL didInit = NO;
|
||||
return nil;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
fprintf(stderr, "AppleScript: scriptTab: %i\n", tabIndex);
|
||||
#endif
|
||||
return [GeckoTab tabWithIndex:tabIndex andContentWindow:contentWindow andWindow:self];
|
||||
}
|
||||
|
||||
@ -885,6 +888,7 @@ static BOOL didInit = NO;
|
||||
}
|
||||
|
||||
- (NSString*)handleRunJavaScriptCommand:(NSScriptCommand*)command {
|
||||
NS_WARNING("AppleScript: runJavaScript");
|
||||
nsCOMPtr<nsIApplescriptService> applescriptService(do_GetService("@mozilla.org/applescript-service;1"));
|
||||
if (applescriptService) {
|
||||
NSDictionary *args = [command evaluatedArguments];
|
||||
@ -896,6 +900,9 @@ static BOOL didInit = NO;
|
||||
|
||||
s.Assign([script UTF8String]);
|
||||
r.Truncate();
|
||||
#if DEBUG
|
||||
fprintf(stderr, "AppleScript: run script: win %i tab %i\n", [mWindow orderedIndex], mIndex);
|
||||
#endif
|
||||
if (NS_SUCCEEDED(applescriptService->RunScriptInTabAtIndexInWindow(mIndex,
|
||||
[mWindow orderedIndex],
|
||||
s, r, &ok))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user