GM_openInTab open as child scriptish #276

Closed
gynuqddr opened this Issue Apr 17, 2012 · 9 comments

2 participants

@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 ?

@piroor
Owner

The commit 3b9c542 introduces compatibility with Scriptish 0.1.7.

@piroor piroor closed this May 1, 2012
@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

@piroor piroor reopened this May 2, 2012
@piroor
Owner

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

@piroor
Owner

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.

@piroor
Owner

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.)

@piroor
Owner

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.

@piroor
Owner

scriptish/scriptish#9 pull request

@piroor
Owner

I close this issue because a new version of TST is released. If the problem still there, please comment here. Thanks.

@piroor piroor closed this Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment