-
Notifications
You must be signed in to change notification settings - Fork 6
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
Passing arguments to apps functions #28
Comments
Hello @theottm!
That's correct and only reason for this behavior is my decision to not bother with multiple windows so far mostly because my own use-case involve only one browser window 99% of the time. If you need multiple windows support, I'd suggest creating another issue on Github. I'll get to it once I have some breathing room. Or you can also take a jibe at implementing it yourself, I'll be very happy to help you in any capacity I can 🙂
This extension is supposed to run from inside user's machine without any remote capabilities of itself. So avoiding js-injection in any manner isn't a concern right now. I introduced the concept of 'apps' as an isolation-mechanism so:
You can try thinking of 'apps' in spookfox as emacs packages or firefox addons. That's my intention with them at least, how far I can take it is a different matter of course 😄 I wish it was better documented; that's another thing on my todo list, just waiting for things irl to settle down a bit.
You're correct here; it's pretty straight-forward message/request passing b/w Emas and Firefox.
That's correct, and is the reason why apps can't be the "extend Firefox on whim" abstraction I want them to be. Browser won't allow injecting javascript on-the-fly even into browser addons. I intend to introduce a compile-to-js thingy into spookfox to work around this; for example biwascheme. But for now, only way to extend firefox side of things is by building the firefox-addon locally. But for now, if you want to make any change on browser side, you need to re-build the addon.
You can always create your own spookfox 'app' and have it behave in this way; if it works well, other apps can be ported so most of the actual work is done on Emacs side. :-) I hope I was able to make things a bit clearer. Please feel free to ask any questions or feature requests (preferably as individual github issues so they're easy to track) or if you need help with js (in case you want to hack on it yourself). Thank you for trying Spookfox out! It brings me great pleasure to know my code was able to help someone out a little :-) |
Hello @theottm, Today I encountered a bug in my most used workflow (working with active tab in firefox), which was resulted by default windowId for my browser being not 1. During fixing this, I thought of creating a small example for you for passing arguments from emacs side to typescript. Please take a look at these two commits. I still haven't added support for multiple browser windows all around, but |
Hello @bitspook,
Thanks for your help, it is greatly appreciated!
I haven't looked deeper into spookfox since last time I wrote here, but
this sure gives me an incentive to try it out again! I'll keep you up to
date with progress and struggles :)
Cheers,
Théo
…On Wed, Jan 4, 2023, 18:53 Charanjit Singh ***@***.***> wrote:
Hello @theottm <https://github.com/theottm>,
Today I encountered a bug in my most used workflow (working with active
tab in firefox), which was resulted by default windowId for my browser
being not 1. During fixing this, I thought of creating a small example for
you for passing arguments from emacs side to typescript. Please take a look
at these
<e5502f7>
two
<fe210ec>
commits.
I still haven't added support for multiple browser windows all around, but
(spookfox-request-active-tab) now accepts an optional window-id argument.
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHKQJUKJCCPFF5BKDHA5KSLWQW2IZANCNFSM6AAAAAATBOPAXU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi!
First of all good job making firefox controllable from emacs !
I have been playing around with the code a bit... and it works great! I just got a bit confused that only the first window is accessible when doing things with tabs.
I am at baby level in web technologies, so I am obviously missing some basics. I have a few questions.
Why are you slitting the functionalities in apps that take
EmacsRequests
? Is it to avoid js injection?How would one extend
Tabs.ts
to receive a parameter specifying a windowId? I see thatopenSearchTab
as well asopenTab
can get a parameterp
. So it seems that I can set p to a key-value structure and access them in the function. On the emacs-side it seems calling(spookfox-tabs--request client "SEARCH_FOR" tab)
will callopenSearchTab
with p being tab, right? So it seems pretty straightforward.Also if I understand right, if I want to add parameters to the functions in
Tabs.ts
, I'll have to recompile the addon myself. I'll have a look at contributing.org then ;)For my use case, since I struggle doing any js, when I want to query some data from firefox, it would be nice to have an app that just returns almost all the state of firefox, and process it in emacs. I imagine it being too slow and overkill but maybe there is a nice threshold to find. It could be nice to have anyway for quick experimentation purposes.
Cheers,
Théo
The text was updated successfully, but these errors were encountered: