Description
When shredding a website, we should clear the motion & orientation permissions of that website.
Current Issues
Apple does not currently provide an explicit API to reset these permissions. The device motion & device orientation permission is reset/cleared when the app is quit and relaunched. Reloading the page and/or removing the WKWebView and creating a new one do not suffice.
Apple provides a delegate function webView(_:requestDeviceOrientationAndMotionPermissionFor:initiatedByFrame:decisionHandler:), but once responding with WKPermissionDecision.prompt (and user selecting 'Allow') or WKPermissionDecision.grant, the delegate function is not called again until next app launch.
On iOS 17 and later, we can create a new WKWebsiteDataStore using the init(forIdentifier:) to create a new profile, however this would reset the data store for the entire WKWebView, clearing data for all domains where Shred is domain-specific.
Reactions are currently unavailable
Description
When shredding a website, we should clear the motion & orientation permissions of that website.
Current Issues
Apple does not currently provide an explicit API to reset these permissions. The device motion & device orientation permission is reset/cleared when the app is quit and relaunched. Reloading the page and/or removing the WKWebView and creating a new one do not suffice.
Apple provides a delegate function webView(_:requestDeviceOrientationAndMotionPermissionFor:initiatedByFrame:decisionHandler:), but once responding with WKPermissionDecision.prompt (and user selecting 'Allow') or WKPermissionDecision.grant, the delegate function is not called again until next app launch.
On iOS 17 and later, we can create a new WKWebsiteDataStore using the init(forIdentifier:) to create a new profile, however this would reset the data store for the entire WKWebView, clearing data for all domains where Shred is domain-specific.