Allow to disable screenshots by platform
cillian-cwb opened this issue · 16 comments
The only forceStyle that work is 'chrome'.
'apple-mobile' and 'apple-desktop' must be possible to set. They now get what is set in forceStyle 'chrome.
Not sure what do you mean. Can you describe what do you trying to do?
I am trying to disable screenshots on chrome, since install leads to native install dialog with screenshots as well.
But if I disable for chrome, it also disable for Safari mobile and desktop. And for Safari mobile and desktop it is necessary with the screenshots.
Hmm I see. You can try to work around this by checking the isAppleDesktopPlatform and isAppleMobilePlatform values, and toggle screenshots. But I'll think about it.
I have checked their values and detection code. Detection code seems ok, but none of the isAppleDesktopPlatform and isAppleMobilePlatform values change anything for them. Only the 'chrome' values
@cillian-cwb check the demo page or in package.json use the github version: "github:khmyznikov/pwa-install". I've added disable-screenshots-apple and disable-screenshots-chrome params
@cillian-cwb check the demo page or in package.json use the github version: "github:khmyznikov/pwa-install". I've added disable-screenshots-apple and disable-screenshots-chrome params
@khmyznikov Great!!! Works nicely in your demo. But I'm having problem to get it updated in my project. I have downloaded pwa-install and uploaded the files to pwa-install in node-modules and replaced pwa-install.bundle.js with your current one. Can't I use forceStyle('apple-mobile');
disableInstallDescription({ checked: false });
disableScreenshots({ checked: false });
disableClose({ checked: false });
setAttr('attr', 'any value');
forceStyle('chrome');
disableInstallDescription({ checked: false });
disableScreenshots({ checked: true });
disableClose({ checked: false });
setAttr('attr', 'any value'); anymore???
Looks like you're using it the wrong way. Check readme section about supported parameters https://github.com/khmyznikov/pwa-install?tab=readme-ov-file#supported-params
Looks like you're using it the wrong way. Check readme section about supported parameters https://github.com/khmyznikov/pwa-install?tab=readme-ov-file#supported-params
Ok. Do you recommend using it with your control panel???? I have so far excluded that part.
@cillian-cwb what framework do you use? The control panel on demo site is mostly just for demo, not a guide. You don't need to force any style, just set the parameters on element, listen events and call methods.
added in 0.4.3
@cillian-cwb what framework do you use? The control panel on demo site is mostly just for demo, not a guide. You don't need to force any style, just set the parameters on element, listen events and call methods.
I don't use any framework. Not viable for my project. Sorry for late feedback. So still I'm not able to figure out how to set my code to get your last updates. Any further tips would be to great help.
I see you closed this now, but Android and iOS still doesn't get nb-NO. So with 'no' they still get English in your demo. Same for desktop Safari. Lower case-Upper case is needed.
<pwa-install id="pwa-install" disable-screenshots-chrome="true"></pwa-install>
like this you can set by default any supported properties. Use removeAttribute/setAttribute from js only if you need to set something dynamically.
Thank you @khmyznikov
I cleaned out all pwa-install from my js and it worked.
How to use removeAttribute/setAttributein in js? I removed the forceStyle, createElement and addeventListeners, since I noticed this gave me double.
Hello. I'm trying to use showDialog() and hideDialog() on manual-apple="true". How can I do that without a framework???
<pwa-install id="pwa-install" manual-apple="true"></pwa-install>
var pwaInstall = document.getElementById("pwa-install");
pwaInstall.showDialog();