Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GM_openInTab open as child scriptish #276

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

GM_openInTab open as child scriptish #276

gynuqddr opened this issue Apr 17, 2012 · 9 comments
Labels
extension-compatibility conflict with another addon

Comments

@gynuqddr
Copy link

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
Copy link
Owner

piroor commented May 1, 2012

The commit 3b9c542 introduces compatibility with Scriptish 0.1.7.

@piroor piroor closed this as completed May 1, 2012
@gynuqddr
Copy link
Author

gynuqddr commented May 2, 2012

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
Copy link
Owner

piroor commented May 2, 2012

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

@piroor
Copy link
Owner

piroor commented May 2, 2012

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
Copy link
Author

gynuqddr commented May 2, 2012

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
Copy link
Owner

piroor commented May 2, 2012

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
Copy link
Owner

piroor commented May 2, 2012

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
Copy link
Owner

piroor commented May 2, 2012

scriptish/scriptish#9 pull request

@piroor
Copy link
Owner

piroor commented Feb 12, 2016

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 as completed Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-compatibility conflict with another addon
Projects
None yet
Development

No branches or pull requests

2 participants