Fix extension popup in chrome
This commit is contained in:
parent
eb02865131
commit
7d8f3912bb
@ -5,13 +5,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import BrowserDetect from '../../ext/conf/BrowserDetect';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
icon: String,
|
icon: String,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
// note — webextension-polyfill is not gonna save us here.
|
||||||
|
// been there, tried that.
|
||||||
return {
|
return {
|
||||||
bootstrapIconsBasePath: (browser ?? chrome).runtime.getURL('/res/icons/bootstrap-icons.svg'),
|
bootstrapIconsBasePath: (BrowserDetect.firefox ? browser : chrome).runtime.getURL('/res/icons/bootstrap-icons.svg'),
|
||||||
iconHref: '',
|
iconHref: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -213,6 +213,7 @@ export default {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (BrowserDetect.firefox) {
|
if (BrowserDetect.firefox) {
|
||||||
|
// reminder — webextension-polyfill doesn't seem to work in vue!
|
||||||
await browser.permissions.request({permissions: ['downloads']});
|
await browser.permissions.request({permissions: ['downloads']});
|
||||||
browser.downloads.download({saveAs: true, filename: 'ultrawidify-settings.json', url: fileUrl});
|
browser.downloads.download({saveAs: true, filename: 'ultrawidify-settings.json', url: fileUrl});
|
||||||
} else if (BrowserDetect.chrome) {
|
} else if (BrowserDetect.chrome) {
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!--
|
||||||
|
NOTE — the code that makes ultrawidify popup work in firefox regardless of whether the
|
||||||
|
extension is being displayed in a normal or a small/overflow popup breaks the popup
|
||||||
|
behaviour on Chrome (where the popup would never reach the full width of 800px)
|
||||||
|
|
||||||
|
Since I'm tired and the hour is getting late, we'll just add an extra CSS class for
|
||||||
|
non-firefox builds of this extension and be done with it. No need to complicate things
|
||||||
|
further than that.
|
||||||
|
-->
|
||||||
<div v-if="settingsInitialized"
|
<div v-if="settingsInitialized"
|
||||||
class="popup flex flex-column no-overflow"
|
class="popup flex flex-column no-overflow"
|
||||||
|
:class="{'popup-chrome': ! BrowserDetect.firefox}"
|
||||||
>
|
>
|
||||||
<div class="flex-row flex-nogrow flex-noshrink relative"
|
<div class="flex-row flex-nogrow flex-noshrink relative"
|
||||||
:class="{'header': !narrowPopup, 'header-small': narrowPopup}"
|
:class="{'header': !narrowPopup, 'header-small': narrowPopup}"
|
||||||
@ -289,7 +299,8 @@ export default {
|
|||||||
AboutPanel,
|
AboutPanel,
|
||||||
Donate,
|
Donate,
|
||||||
SiteDetailsPanel,
|
SiteDetailsPanel,
|
||||||
WhatsNewPanel, Icon
|
WhatsNewPanel,
|
||||||
|
Icon,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async sleep(t) {
|
async sleep(t) {
|
||||||
@ -660,11 +671,27 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.popup {
|
.popup {
|
||||||
// max-width: 780px;
|
|
||||||
// width: 800px;
|
|
||||||
height: 600px;
|
height: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
This was written at the top, but it's worth repeating.
|
||||||
|
|
||||||
|
NOTE — the code that makes ultrawidify popup work in firefox regardless of whether the
|
||||||
|
extension is being displayed in a normal or a small/overflow popup breaks the popup
|
||||||
|
behaviour on Chrome (where the popup would never reach the full width of 800px)
|
||||||
|
|
||||||
|
Since I'm tired and the hour is getting late, we'll just add an extra CSS class for
|
||||||
|
non-firefox builds of this extension and be done with it. No need to complicate things
|
||||||
|
further than that.
|
||||||
|
|
||||||
|
It also seems that Chrome doesn't like if we set the width of the popup all the way to
|
||||||
|
800px (probably something something scrollbar), so let's just take away a few px.
|
||||||
|
*/
|
||||||
|
.popup-chrome {
|
||||||
|
width: 780px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.relative {
|
.relative {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
addonVersion: browser.runtime.getManifest().version || chrome.runtime.getManifest().version,
|
// reminder — webextension-polyfill doesn't seem to work in vue!
|
||||||
|
addonVersion: BrowserDetect.firefox ? browser.runtime.getManifest().version : chrome.runtime.getManifest().version,
|
||||||
loggingEnabled: false,
|
loggingEnabled: false,
|
||||||
loggerSettings: '',
|
loggerSettings: '',
|
||||||
loggerSettingsError: false,
|
loggerSettingsError: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user