File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ async function init() {
109109 }
110110 } ) ;
111111
112+ if ( ui . instance . isPopup ( ) ) {
113+ ui . instance . fixPopupSize ( ) ;
114+ }
115+
112116 return ;
113117}
114118
Original file line number Diff line number Diff line change @@ -145,6 +145,18 @@ async function menu(_ui: UI) {
145145 new URLSearchParams ( document . location . search . substring ( 1 ) ) ;
146146 return params . get ( 'popup' ) ;
147147 } ,
148+ fixPopupSize : ( ) => {
149+ const zoom = Number ( localStorage . zoom ) / 100 || 1 ;
150+ const correctHeight = 480 * zoom ;
151+ const correctWidth = 320 * zoom ;
152+ if ( window . innerHeight !== correctHeight ||
153+ window . innerWidth !== correctWidth ) {
154+ chrome . windows . getCurrent ( ( currentWindow ) => {
155+ chrome . windows . update (
156+ currentWindow . id , { height : correctHeight , width : correctWidth } ) ;
157+ } ) ;
158+ }
159+ } ,
148160 dropboxUpload : async ( ) => {
149161 const dbox = new Dropbox ( ) ;
150162 const response = await dbox . upload ( _ui . instance . encryption ) ;
You can’t perform that action at this time.
0 commit comments