File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ browser.storage.onChanged.addListener(function(changes) {
2323} ) ;
2424
2525browser . tabs . onActivated . addListener ( function ( activeInfo ) {
26- browser . tabs . get ( activeInfo . tabId , function ( activeTab ) {
26+ browser . tabs . get ( activeInfo . tabId ) . then ( function ( activeTab ) {
2727 lastActiveTab = {
2828 "id" : activeTab . id ,
2929 "pinned" : activeTab . pinned
@@ -35,20 +35,22 @@ browser.tabs.onCreated.addListener(function(tab) {
3535 if ( lastActiveTab . pinned ) {
3636 browser . tabs . query ( {
3737 windowId : tab . windowId
38- } , function ( tabs ) {
38+ } )
39+ . then ( function ( tabs ) {
3940 // check if tab was opened from outside of firefox or is about:newtab
4041 if ( tab . index != tabs . length - 1 ) {
41- browser . tabs . move ( tab . id , {
42+ return browser . tabs . move ( tab . id , {
4243 index : - 1
43- } , function ( ) {
44- // in all cases scroll tab bar to the right
45- browser . tabs . update ( tab . id , { active : true } ) ;
46-
47- if ( loadInBackground ) {
48- browser . tabs . update ( lastActiveTab . id , { active : true } ) ;
49- }
5044 } ) ;
5145 }
46+ } )
47+ . then ( function ( ) {
48+ // in all cases scroll tab bar to the right
49+ browser . tabs . update ( tab . id , { active : true } ) ;
50+
51+ if ( loadInBackground ) {
52+ browser . tabs . update ( lastActiveTab . id , { active : true } ) ;
53+ }
5254 } ) ;
5355 }
5456} ) ;
Original file line number Diff line number Diff line change 22
33 "manifest_version" : 2 ,
44 "name" : " Pinned Tab Fix" ,
5- "version" : " 2.0.7 " ,
5+ "version" : " 2.2.0 " ,
66
77 "description" : " __MSG_extensionDescription__" ,
88 "homepage_url" : " https://github.com/nralbrecht/pinned-tab-fix" ,
You can’t perform that action at this time.
0 commit comments