[ext] Private Tab (no restart)

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
aeman.amin
New Member
Posts: 1
Joined: August 12th, 2013, 5:41 pm

Re: [ext] Private Tab (no restart)

Post by aeman.amin »

Really good extension..hope to add shortcut key, so that easier to open without go to menu..
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

aeman.amin wrote:Really good extension..hope to add shortcut key, so that easier to open without go to menu..

You can use Ctrl+Alt+P to open new private tab and Ctrl+Alt+V to toggle private state of current tab.
Also you can change shortcuts using extensions.privateTab.key.* options in about:config page.
This game has no name. It will never be the same. ©
User avatar
Grg68
Posts: 41
Joined: January 21st, 2011, 12:36 pm
Location: Greece, island of Crete, Chania

Re: [ext] Private Tab (no restart)

Post by Grg68 »

hi Infocatcher!,
I'm George, the Greek translator.
Recently i noticed some error messages in error console and i would like
to inform you, just in case they have a meaning for you and you are interested
to examine them.
There is no any functional issue of Private Tab, i was looking at the error
console for something else and i noticed also these errors, related to Private Tab.

1.
Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.default/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 544

2.
Error: TypeError: tab.linkedBrowser is null
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.default/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 2459

Thanks
Grg
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

Grg68 wrote:Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
This is known issue (currently described in Developer’s Comments section) and related to Bug 800193 - Make the nsILoadContext.usePrivateBrowsing property read-only. Fortunately nsILoadContext.usePrivateBrowsing is still writable, but produces above warning after each change.

Grg68 wrote:Error: TypeError: tab.linkedBrowser is null
Seems like Private Tab tries to do something with already closed tab.
Can you provide steps to reproduce this?

Also I added more detailed error message for this case:
https://github.com/Infocatcher/Private_Tab/commit/a6370298ef8270e45056e1e4fa916fd349091fed
Test version with this patch: private_tab-0.1.4pre8-fx-sm.xpi (source).

Anyway, in most cases there is nothing to do with closed tabs, but it's also wrong to access them (and it's better to correct).
This game has no name. It will never be the same. ©
User avatar
Grg68
Posts: 41
Joined: January 21st, 2011, 12:36 pm
Location: Greece, island of Crete, Chania

Re: [ext] Private Tab (no restart)

Post by Grg68 »

Hi again,
Infocatcher wrote:Can you provide steps to reproduce this?

No, unfortunately i can't provide specific steps to reproduce this.
Watching the error console for a while, i noticed that both error
messages occur randomly i could say, at least in relation to user
actions.
In other words, when the error console logs these errors, i don't
do anything related to Private Tab or even to private browsing in
general.
So i'm sorry but i can't help..

I will try the test version to see any differences.
Grg
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

Private Tab 0.1.4: https://addons.mozilla.org/addon/private-tab/versions/0.1.4

Grg68
Thanks anyway.
I released new version with better error logging, so just update and copy additional error message next time. :)
This game has no name. It will never be the same. ©
mickeyjuice
Posts: 5
Joined: June 26th, 2008, 3:22 pm

Re: [ext] Private Tab (no restart)

Post by mickeyjuice »

Super extension, thank you.

I read that there's no easy way to make a bookmark automatically open as a private tab, but is there any way to make something like a whitelist of URLs that would automatically open as private? (I suspect the answer is no, but just thought I'd ask.)

Thanks again!
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

mickeyjuice wrote:I read that there's no easy way to make a bookmark automatically open as a private tab, but is there any way to make something like a whitelist of URLs that would automatically open as private? (I suspect the answer is no, but just thought I'd ask.)

My reply about bookmarks is obsolete, sine version 0.1.4 (not yet reviewed) you can prefix URL with "private:///#" to open it in private tab.

And about whitelist: http://forums.mozillazine.org/viewtopic.php?p=12922835#p12922835.
I still don't know, how to do the main part about changing of request's "private" flag, e.g. nsIContentPolicy is useless because aContext will be associated with global browser window for bookmarks.
This game has no name. It will never be the same. ©
mickeyjuice
Posts: 5
Joined: June 26th, 2008, 3:22 pm

Re: [ext] Private Tab (no restart)

Post by mickeyjuice »

Infocatcher wrote:
mickeyjuice wrote:I read that there's no easy way to make a bookmark automatically open as a private tab, but is there any way to make something like a whitelist of URLs that would automatically open as private? (I suspect the answer is no, but just thought I'd ask.)

My reply about bookmarks is obsolete, sine version 0.1.4 (not yet reviewed) you can prefix URL with "private:///#" to open it in private tab.kmarks.


Brilliant stuff, thanks for that.

Having it happen automatically (whitelist) would be great, so hopefully you can sort that out later on. But for now, this is great.
User avatar
Grg68
Posts: 41
Joined: January 21st, 2011, 12:36 pm
Location: Greece, island of Crete, Chania

Re: [ext] Private Tab (no restart)

Post by Grg68 »

Hi Infocatcher,

I tested v0.1.4 and i don't noticed the error messages i reported previously
for v0.1.3.
However, now there are some other issues "under the hood", meaning
without any visible malfunctions.

- When i open a new private tab, i get this warning message in error console:

Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 2267

I noticed also a hard "fight" "under the hood", when your extension is used
alongside with UnloadTab.
The moment a private tab gets unloaded, i get the following warning/
errors in error console:
-------------------------------------------
Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 645
-------------------------------------------
Error: [Private Tab] getTabPrivacyContext() called for already destroyed tab, call stack:
@resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js:2632
@resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js:2638
@resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js:2194
@resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js:883

Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 2632
-------------------------------------------
Error: TypeError: tab.linkedBrowser is null
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 2635
-------------------------------------------

I appreciate your efforts to make PT even better, among other new features, the
ability to put the button of PT beside the new tab button is welcome but, since
things are very complicated, i believe that it worths to focus your attention to
real code, to solve severe problems, like conflicts, incompatibilities, etc.
I say that because i noticed that maybe you will try to make it possible for the
button to be placed also before the new tab button, to satisfy all kind of
feature requests in the world!
Personally i know that the essential thing is the real code and i am pretty
enough satisfied so far with the result of your hard work!
After the real code, if you have some free time, of course you can also "polish"
the extension, based on your own or on your users ideas! :-)

Thank you
Grg
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

Grg68 wrote:I noticed also a hard "fight" "under the hood", when your extension is used
alongside with UnloadTab.

Thanks, I reproduced it.
This started from bootstrap.js#L883 – I'm doing a small delay before check tab state after that tab has been opened (to show correct state, if someone will make that tab private). And UnloadTab uses blank tab (chrome/content/unloadtab.js#L991) and then immediately replace tab "to unload" with this new tab (chrome/content/unloadtab.js#L996) and this also closes new tab.
Should be fixed now:
https://github.com/Infocatcher/Private_Tab/commit/e1fe7a87db93b11aed7d303edea0a2332c84e573
But this is only error message, without consequences. :)

Grg68 wrote:I appreciate your efforts to make PT even better, among other new features ...

Thanks. :)

Grg68 wrote:I say that because i noticed that maybe you will try to make it possible for the
button to be placed also before the new tab button, to satisfy all kind of
feature requests in the world!

Yes, may be. But this isn't simple: unfortunately Firefox doesn't provide customisable toolbar after last tab and use two "New Tab" buttons (and hide unwanted one using CSS). So I have the same: hardcoded "New Private Tab" button after last tab and built-in "New Tab" button. So I need to play with -moz-box-ordinal-group or change order physically after aftercustomization event. And also show built-in "New Tab" button after last tab (because built-in styles works only for "New Tab" just after tab bar).
This game has no name. It will never be the same. ©
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

About "New Private Tab" + "New Tab" after last tab:
https://github.com/Infocatcher/Private_Tab/issues/92
Not so "isn't simple", but unfortunately complicated. :)
This game has no name. It will never be the same. ©
User avatar
Grg68
Posts: 41
Joined: January 21st, 2011, 12:36 pm
Location: Greece, island of Crete, Chania

Re: [ext] Private Tab (no restart)

Post by Grg68 »

Hi Infocatcher,

This is my latest report of v0.1.5pre:

- Now i don't see any errors when i open or unload (with UnloadTab) a private tab.
Only the following XML warnings:

On opening a new private tab:
Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 2294

On unloading a private or normal tab:
Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
Source file: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Documents%20and%20Settings/jm/Application%20Data/Mozilla/Firefox/Profiles/firefox_4+.helloworld-dev/extensions/privateTab@infocatcher.xpi!/bootstrap.js
Line: 647


- I noticed that when i open a new private tab, the title of the window says: "Mozilla Firefox (Private Browsing)"
(in menu bar mode, in central button mode mozillians forgot the title..).
I have to go to another tab and return to newly opened private tab for the title
to be updated, showing: "New Tab - Mozilla Firefox (Private Browsing)".
Later on, i saw the same on opening a new normal tab, even with Private Tab
disabled, so probably this is an issue of firefox. What you think about?

- About the button of PT before the new tab button, well, eventually you did it too!
Although it is not something important, like resolving conflicts, incompatibilities, etc,
because it wasn't so easy to do it, i feel the need to say again Thank you! =D>
However, since you want to care all the details to satisfy all the people,
unfortunately i have to inform you that there is a little (i hope..) more
work for you!:
Having the button of PT before the new tab button, if you disable PT, both
buttons disappear (when they are not visible real tab bar buttons).
This happens only when all tabs are visible. If not, the new tab button remains but,
if you close some tabs or maximize the window to make all tabs visible,
the new tab button disappears until you re-enable PT.
Grg
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

This game has no name. It will never be the same. ©
User avatar
Infocatcher
Posts: 257
Joined: July 1st, 2007, 3:45 am

Re: [ext] Private Tab (no restart)

Post by Infocatcher »

Grg68 wrote:Warning: Only internal code is allowed to set the usePrivateBrowsing attribute
Sorry, I forgot to write about this in first time.
This warning can't be fixed or suppressed. I should change nsILoadContext.usePrivateBrowsing to make tabs private and browser shows "Only internal code..." warning after each nsILoadContext.usePrivateBrowsing = ... assignment.

Grg68 wrote:- I noticed that when i open a new private tab, the title of the window says: "Mozilla Firefox (Private Browsing)"
(in menu bar mode, in central button mode mozillians forgot the title..).
I have to go to another tab and return to newly opened private tab for the title
to be updated, showing: "New Tab - Mozilla Firefox (Private Browsing)".
Later on, i saw the same on opening a new normal tab, even with Private Tab
disabled, so probably this is an issue of firefox. What you think about?
I see. The same happens (for me too) for new tabs without Private Tab, so looks like Firefox bug.

Grg68 wrote:Having the button of PT before the new tab button, if you disable PT, both
buttons disappear (when they are not visible real tab bar buttons).
Yes, this is because built-in styles for "New Tab" buttons depends on "currentset" attribute of tabs toolbar. And works only for "tabbrowser-tabs,new-tab-button". But with "New Private Tab" button there is "tabbrowser-tabs,privateTab-toolbar-openNewPrivateTab,new-tab-button" (buttons for removed/disabled extensions aren't cleaned from toolbars automatically). But you can change tabs toolbar somehow (e.g. remove "New Tab" button) and then restore "Tabs Toolbar" – "New Tab" in sibling order.
This game has no name. It will never be the same. ©
Post Reply