GNOME Bugzilla – Bug 693814
Looking glass: Extensions tab: buttons closing lg
Last modified: 2013-02-20 23:17:22 UTC
Created attachment 236086 [details] [review] [PATCH] lg: add a reference to lookingGlass in the Extensions tab. [PATCH] lg: add a reference to lookingGlass in the Extensions tab. When the user clicks on "View Source" or "Web Page" in the "Extensions" tab of looking glass, the callback _onViewSource() or _onWebPage() is called and they try to close looking glass: this._lookingGlass.close(); But it does not work and generate the exception "this._lookingGlass is undefined". This patch fixes that.
Review of attachment 236086 [details] [review]: ::: js/ui/lookingGlass.js @@ +915,2 @@ this._extensions = new Extensions(); + this._extensions._lookingGlass = this; No. You should never access (not to mention *write*) a private property from the outside. Instead, do what all the other tabs do: (1) Add a "lookingGlass" parameter to the Extensions class (2) Do "this._lookingGlass = lookingGlass;" in Extensions' _init() (3) Call it like "this._extensions = new Extensions(this);"
Created attachment 236972 [details] [review] [PATCH] lg: add a reference to lookingGlass in the Extensions tab. Thanks for the review. Patch updated with: - pass lookingGlass through Extensions' constructor - add bug URL in the commit log
Review of attachment 236972 [details] [review]: This is correct.
Comment on attachment 236972 [details] [review] [PATCH] lg: add a reference to lookingGlass in the Extensions tab. Committed on master as a8a4a85daccf35a02afcc232735cb046e55b6ab9