Disable Screen Lock API in Chromium Browser - chromium

Is there a way to disable the Screen Wake Lock API in Chromium Browser, so that it cannot be used by websites / web app?
Background: I have an app (not mine, so I can't change the code) running in kiosk mode on a raspberry pi which unfortuneatly grabs a Screen Lock so the screen never switches off. I'd like to "override" that so that the screen goes to sleep normally.

Related

Headless does not work after closing app

I have used Headless from React Native.
I have setup all configuration for it and run my test script as showed in offical site tutorial.
It works when my app is working in foreground.
Whenever I close or switch another app, my background script also stop working.
Is there any option to allow code to work in background after closing app?

WatchOS app keeps crashing when being opened from remote notification

WatchOS app works normally if being opened from home screen. If I try to open it from remote notification screen (by tapping title label) two app behaviors can be spotted:
If application was loaded previously (I don't know how to name it, maybe better to tell that app is not killed by system or still present in memory). In this case application will load normally and do some action if asked (for example open some Interface Controller and show remote notification details).
If application was launched long time ago (or killed by system, unloaded from memory, in my case I'm stopping it in Xcode). If app receives remote notification in this state after tapping on title label of notification scene it will try to load for some time and finally crash (this may take 1sec or 1min). Or it will stuck with loading indicator shown - what is interesting that in this case if I'll try to attach watch extension process to Xcode debug it will show that app is launched and works (for example I can send some data from parent iOS app and watchOS app will receive it - triggered method in Extension delegate and do some stuff).
Googling I have found that watch apps can be killed by system if they take to much power when being launched, so I tried to remove any load while app is starting itself but with no success - it still keeps crashing.
The only close to mine situation that I've found so far was a topic in apple developers forum:
https://forums.developer.apple.com/thread/20553
I have been spotting the same logs like in topic when watching how watch app behave in Xcode/Devices, but after updating to WatchOS 3 (now 3.1 beta) and using new Xcode 8 (now 8.1 beta) I can't see any logs from WatchOS at all (just some system messages that watch screen was turned of and on).
Have any one spotted such issues while working with watchOS remote notifications? Any suggestion where to search for solution?

What happens when the user hits the home button?

I have an app which can currently communicate with an server.
Imagine the following case:
User hits some buttons which triggers an server request.
The request is send to the server and is processed.
The user hits the home button (and maybe removes the app from the
memory by hitting the home button two times).
The script is done processing and returns it result.
Question: Will the device from the user gets this response (I am pretty sure it will not when removing from memory, but what when just closing the app)?
There are 5 active states in iOS:
Not running: The app has not been launched or was running but was
terminated by the system.
Inactive: The app is running in the foreground, but not receiving
events. An iOS app can be placed into an inactive state, for
example, when a call or SMS message is received.
Active: The app is running in the foreground, and receiving
events.
Background: The app is running in the background, and executing
code.
Suspended: The app is in the background, but no code is being
executed.
On your third scenario where the user hits the home button, the app will be sent into the Background state, #4, and can still receive data and allow your script to run. If the user kills the app, (state #1) your script will not complete running.
So, to answer your question, yes your app will continue executing code if the user places it in the Background state, but not if they close the app because that will put your app in the Not Running state.
Application is suspended (on the background, not running) - In this case the execution of you requests get paused. When your app gets to the foreground, usually the requests end with a timeout.
Application is terminated - in this case the context of your application is lost and after restarting there are no running requests.
That's the 2 cases you should be concerned about. For me it a good solution to cancel all running requests when the application is entering background because it is easier to restart everything when the app gets to foreground again.
Also, you can setup background mode and that enables the app to perform some code when on the background but that's a more advanced topic.

Chrome dev tools site gets stuck in mobile view when exiting emulation mode

When using chrome dev tools to emulate mobile devices, sometimes when toggling emulation from mobile back to desktop the user agent spoofing gets stuck in mobile. I've tried hard cache reset, closing browser completely, restore to default.... but anything I do the site still renders in mobile (even when emulation is turned off).
This happens in Canary, beta, and regular Chrome.
Also a note i've only seen this happen in Sharepoint.
Anyone know how to resolve? Nothing seems to get the dev tools to change user agent back to default when exiting emulation.
Have you tried deleting your chrome settings?
Windows: C:/Users/%username%/AppData/Local/Google/Chrome/User Data
Mac OSX: ~/Library/Application Support/Google/Chrome/
Ubuntu: ~/.config/chromium/
Also make sure you aren't ZOOMED! Gets ya everytime
I ran into this same problem previously when using dev tools in Chrome to look at mobile resolutions that got me permanently stuck in mobile for SharePoint only. I solved it originally with the recommendation above of deleting my Chrome settings folder, however, that meant I had to sign in again, sync my extensions, etc.
After forgetting that this would happen again, I ran into the same issue, but this time I discovered that if you append the following to your SharePoint URL it will reset this back to non-mobile. I verified that it is not temporary as I have closed my browser, reopened, visited SharePoint, and it still loads in desktop mode.
/?mobile=0
So, you would use your site url, e.g. https://siteurl/?mobile=0
Weird, this just started happening to me. It persists in new tabs and new windows. Only fix is to open DevTools and switch to Responsive mode and then pull it way out. As soon as I turn off Responsive / Mobile view, Chrome snaps right back to a mobile view by default (appears to be iPad size).
The solution for me (so far) was to quit Chrome and open it back up.

How to programmatically lock an iPad app into one single application?

we are doing a product display iPad app and don't want customers to be able to quit the app pressing the home button. We're planning to use only UIGesture to let the admin users to quit. How to programmatically lock an iPad app into one single application without install any third party app or profile?
There is a feature for this added in iOS 6 Beta 2 called Guided Access, see http://www.idownloadblog.com/2012/06/26/ios-6-guided-access/
Install the iPhone Configuration Utility: http://support.apple.com/kb/DL1465?viewlocale=en_US&locale=en_US
Make a .mobileconfig with the SBStoreDemoAppLock property set to true
Install the mobile config on the device.
Installation of the mobile config can be done using either the iPCU app or by opening the file with Safari on the device.
Now the device is in kiosk mode and the home button is disabled.
Remove the .mobileconfig file (again using the iPCU app) and reboot the device to re-enable the home button.
I believe that the common solution to this problem is a case that covers the home and power buttons. In practice, you'll want something that is fairly robust to prevent theft of the iPad, and that neatly covers access to the dock connector whilst providing power.
A quick google search of iPad kiosk case turns up plenty of options. Use of iPads as PoS displays in stores and at trade shows is incredibly popular.