Skip to content
This repository

GM_openInTab open as child scriptish #276

Open
gynuqddr opened this Issue · 8 comments

2 participants

gynuqddr YUKI "Piro" Hiroshi
gynuqddr

https://addons.mozilla.org/en-US/firefox/addon/scriptish/

Hi, scriptish is forked better version of greasemonkey. For greasemonkey you made function GM_openInTab open as child tabs. Can you do same for scriptish ?

YUKI "Piro" Hiroshi piroor closed this
YUKI "Piro" Hiroshi
Owner
piroor commented

The commit 3b9c542 introduces compatibility with Scriptish 0.1.7.

gynuqddr

I tried new commit code and it has problem. The new tab opens as child tab of focused tab, not the tab it was fired from.

So if your tab bar looks like this

Tab1 - has focus
Tab2 - fires scriptish GM_openInTab
Tab3

It becomes this:
Tab1 - has focus
New child tab here.
Tab2 - fires scriptish GM_openInTab
Tab3

In greasemonkey the new tab attaches to Tab2 because the GM_openInTab command came from that tab

YUKI "Piro" Hiroshi piroor reopened this
YUKI "Piro" Hiroshi
Owner
piroor commented

Hmm, how can I find the tab GM_openInTab is called from?

YUKI "Piro" Hiroshi
Owner
piroor commented

I think that it is the best solution: Scriptish calls TST's public APIs ( http://piro.sakura.ne.jp/xul/_treestyletab.html.en#api ) by self. Because 3b9c542 is just a dirty hack, there are limitations as you told...

gynuqddr

I'm unsure how to find tab GM_openInTab is called from. I'm very new to programming.

In greasemonkey, it works correctly. Can't you do same thing for scriptish that you did to make greasemonkey work?

.....

Or other fix i can think of is to add api that can be set from user script? greasemonkey and scriptish have command unsafeWindow. Maybe TST can monitor special variable on page to act? So user script can write:

unsafeWindow.TreeStyleTabService = "readyToOpenChildTab";
GM_openInTab("www.google.com");

I don't know if that's possible, but it may be good solution because then you don't have to make dirty hacks for future versions of greasemonkey and scriptish or any other user script extension that is created.

YUKI "Piro" Hiroshi
Owner
piroor commented

In greasemonkey, it works correctly. Can't you do same thing for scriptish that you did to make greasemonkey work?

Yesterday I read source codes of Scriptish, and it is very different from the current Greasemonkey...

Or other fix i can think of is to add api that can be set from user script?

"unsafeWindow" is the "window" object of the web page itself. Adding extra APIs to the object means "provide new web API for any website". It can be a security issue, and, I'll have to write more and more codes to avoid such security problems. I think it is out of focus of TST. (And, adding extra APIs to the "unsafeWindow" requires more hacks for each addon, Greasemonkey and Scriptish.)

YUKI "Piro" Hiroshi
Owner
piroor commented

I've realized that the Scriptish is developed under GitHub: https://github.com/scriptish/scriptish
I'll write a patch for Scriptish and send pull request.

YUKI "Piro" Hiroshi
Owner
piroor commented

scriptish/scriptish#9 pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.