-
-
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
Fix multiple pinned ingress tabs #14
Conversation
And fix multiple pinned ingress tabs #11
@johnd0e what you thing about it? |
Is these 2 features connected?
TM-way in general is not good, as it grants 'full access' by default, which often leads to untidy development style. Plugins actually do not need independent execution, as all we need from plugin - it's setup function, which will be executed by the main IITC script in it's context. But to get pure plugin code IITC-Button has to cut out wrapper (like IITCm does). I am not sure that this my answer is relevant to your question, may be you tell why do you want to mimic tampermonkey? |
Yes. Previously, plugins were inject directly from extension, which made it difficult to support multiple tabs. Now extension creates an event to inject plugin, and each tab inject the plugin, if it is not already enabled. It's important that both old plugin injection and new page event capture, both in context of an extension. But old tabs.executeScript created a context for each plugin, and new way has one context. This allows to get rid of fix But plugins still don't have access to window.PLAYER, so I inject them into the context of page to get rid of code to retrieve user data. I can save function to retrieve user data and run plugins in context of an extension. Use a new injection method for plugins based on a page event, but not run in the page context. So, the choice between the possible untidy development style and an one ugly function to retrieve user data. Now I'm more inclined to the second option.
Unfortunately, there are popular plugins that use custom wrappers and break when removing wrapper. |
We already discussed ingressmosaic plugin, and it's wrapper is broken anyway, so I do not think that workaround with
Again, this single workaround is not worse than injecting of EVERY plugin.
They break because their custom wrapper removed incorrectly. But it's possible to use special processing (depending on plugin name). To summarize:
I'd prefer 2nd approach. |
And fix multiple pinned ingress tabs #11
It's necessary to thoroughly test