-
Notifications
You must be signed in to change notification settings - Fork 16
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
Got JS for replace XBL tabmixbindings working! #3
Conversation
protected, locked and auto reload icon on tab is showing now. |
I don't find any code that trigger the loading of dynamic styles. I can only apply the style by change prefs. Just wonder how this is done on old firefox @onemen . |
It is a little bit convoluted. Most of dynamic style are triggers from modules/DynamicRules.jsm look below for the sequence that trigger it when ever new window is open. setup.js Tabmix.beforeBrowserInitOnLoad = function() {
try {
TabmixSvc.windowStartup.init(window);
} catch (ex) {
this.assert(ex);
} TabmixSvc.jsm this.TabmixSvc = {
...
windowStartup: {
...
Cu.import("resource://tabmixplus/DynamicRules.jsm", tmp);
tmp.DynamicRules.init(aWindow);
...
}
...
} Some other rule can be found by searching for all the calls for gTMPprefObserver.insertRule or this.insertRule |
It looks like there is a problem with the progress bar on tab. The bar just can't get progress accurately only very small amount of pages can have their progress displayed others just have their aCurTotalProgress equals aMaxTotalProgress while the listener first ever been triggered. |
it is better to drop this feature |
Not necessary to drop it. |
Please don't upload the file - tab_mix_plus-0.5.8.1-fx-p.xpi into the pull request. Maybe I just squash all the the pull request into one commit |
I've added .gitignore let observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
mutation.addedNodes.forEach((node) => {
if (node.nodeName == "BODY") {
inserted++;
node.addEventListener( "load", () => onLoadHandler(node), listenerCfg);
updateProgress();
} else if (((node.nodeName == "SCRIPT" ||
node.nodeName == "VIDEO" || node.nodeName == "IMG" ||
node.nodeName == "IFRAME" || node.nodeName == "FRAME") && node.src != "" ) ||
(node.nodeName == "LINK" && node.rel == "stylesheet" && window.matchMedia(node.media))
) {
inserted++;
node.addEventListener( "error", () => onLoadHandler(node), listenerCfg);
node.addEventListener( "abort", () => onLoadHandler(node), listenerCfg);
node.addEventListener( "load", () => onLoadHandler(node), listenerCfg);
updateProgress();
}
});
});
});
|
What will happen when a user with 100+ tabs loads all the tabs at startup ? |
I'm not yet have any success with the content.js the code is not as responsive as the web extension I'm still figuring out why. |
I'm currently working on merging your PR with my local repository, while applying lint rules. I hope to push it to GitHub this week. |
container: aWindow.document.createElement('box') | ||
}; | ||
|
||
setAttribute(node.tempAppend.container, 'style', 'position: fixed; top: 4000px; left: 4000px; opacity: 0.001;'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'setAttribute' is not defined ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one complain an error on you environment?
|
||
data.onBuild = function(aDocument, aDestroy) { | ||
// Find the node in the DOM tree | ||
var node = aDocument.getElementById(this.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'node' used outside of binding context.eslintblock-scoped-var
'node' is already declared in the upper scope.eslintno-shadow
node is argument of getWidgetData, use different var name here
// If it doesn't exist there either, CustomizableUI is using the widget information before it has been overlayed (i.e. opening a new window). | ||
// We get a placeholder for it, then we'll replace it later when the window overlays. | ||
if(!node && !aDestroy) { | ||
var node = aDocument.importNode(Globals.widgets[this.id], true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, it is also unclear if you want the node you declare here be the one that return by line 832
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this whole block of code is actually chopped and pasted here from the Tab-group add-on for handle the toolbarbutton rightly. I didn't change any bit of it so it is sure to look quite weird.
But as long as I can tell they are working fine and not complain.
Thank you @117649 I've just uploaded Tab mix complete history with your code merge to it. I would appreciate if you can add a follow-up to PR #3 (in new PR) for the following:
For future patches pleas open an issue for each feature you are trying to fix and push the code for each issue to a separate pull request. My Todo:
Let me know if there are any issue that you think I should prioritize Since this rewrite is going to take a long time I think we should focus on makeing Tab mix compatible with latest Firefox Nightly and the next Firefox ESR. If compatibility with Waterfox will be straightforward we add it as well |
The only one I know is in the prefs-ce.js don't know who created it but I'm sure it is converted from the old xbl bindings so the comment should just be the translation from the original I hope.
Custom Elements
Yes they are used and almost function just like old time. So now there is only bootstrap way for legacy add-ons which means all things load and execute at a later time I already have to adjust the execute order of some code to get the tab appearance functions work. For the Firefox versions compatibility it is a little bizarre situation here:
I hope you keep the preferences intact at least for the those related to tab appearances. Tab-group compatibility for Tabmix still lives don't want that to be ruined. |
This one is easier then I expect. Now the protect, locked and auto reload icon on tab is showing if you toggle the preference on and off and apply the changes to let the tab box got settings updated.