Skip to content

Commit

Permalink
fix violentmonkey#1882: account for page zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Sep 3, 2023
1 parent 20e743b commit a3d8b31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/popup/views/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,12 @@ export default {
mounted() {
focusMe(this.$el);
keyboardService.enable();
// innerHeight may be bigger than 600px in a mobile browser which displays the popup as a fullscreen page
this.$el.style.maxHeight = Math.min(Math.max(600, innerHeight), screen.availHeight - window.screenY - 8) + 'px';
const rat = devicePixelRatio;
this.$el.style.maxHeight = Math.min(
// innerHeight may exceed 600px in a mobile browser which displays the popup as a fullscreen page
Math.max(600 / rat, innerHeight),
screen.availHeight - screenY - 8 / rat
) + 'px';
this.disposeList = [
keyboardService.register('escape', () => {
const item = this.extras || this.topExtras;
Expand Down

0 comments on commit a3d8b31

Please sign in to comment.