How to enable "Allow Remote Automation" in Safari programmatically - ios

I am using macOS Sierra 10.12.4 with safari version 10.1
I need to enable the Allow Remote Automation option in Develop tab in Safari programmatically.
I can run the below command which changes the com.apple.Safari.plist file in the ~/Library/Preferences and that enables the Develop menu perfectly.
`defaults write com.apple.Safari IncludeDevelopMenu -bool true`
However I did not find any option to enable the "Allow Remote Automation"
Any idea which plist contains that info?

It is not possible to toggle the setting using the method you described.
Starting in Safari 11, you can force safaridriver to authenticate by using the --enable command line option. After authenticating, this menu item will be set. This will also cache the authentication for the rest of your login session. Subsequent invocations of safaridriver (say, by the Selenium libraries) will not need further setup.

It can also be done using AppleScript if it is not possible by modifying the plist. To do that, first enable develop from Safari preferences and then choose Allow Remote Automation from the Develop menu.
Here is the AppleScript that I wrote to enable Allow Remote Automation (this covers both the steps mentioned above).
tell application "Safari" to activate
delay 2
tell application "System Events"
tell application process "Safari"
keystroke "," using command down
set frontmost to true
tell window 1
click button "Advanced" of toolbar 1
delay 2
set theCheckbox to checkbox 4 of group 1 of group 1 of it
tell theCheckbox
if not (its value as boolean) then click theCheckbox
end tell
delay 2
keystroke "w" using command down
delay 2
end tell
tell menu bar item "Develop" of menu bar 1
click
delay 2
click menu item "Allow Remote Automation" of menu 1
delay 2
end tell
end tell
end tell
tell application "Safari" to quit
Note: Here I enabled develop menu from safari preferences only if it is unchecked.
Hope this helps..

Related

How to Security > Privacy settings for a "Watch Me Do" QuickAction in Automator

I'm using Mac OS X 11.0.1 Big Sur
I used Automator to create a "Watch me do" QuickAction. I've saved it (is seems to save in ~/Library/Services by default), and exported it to iCloudDrive/Automator. I can run this script to completion successfully from within Automator without any prompts, warnings or errors.
During export, I was prompted to add it to the Touch Bar, which I did. I can see it on the TouchBar. However, when I run my QuickAction from the TouchBar, I get a popup message indicating that it needs to be added to the Privacy tab:
The action “Watch Me Do” encountered an error: “This application must be allowed to control this computer using accessibility features, using the Security & Privacy preferences located in System Preferences, before using 'Watch Me Do'”
There are two buttons on the popup: Show Workflow and OK
Clicking on "Show Workflow" opens the Workflow in Automator, and does not solve the problem.
Clicking on "OK" closes the popup, does not open the Security Settings, and does not solve the problem.
I can see that Automator is added to Security & Privacy > Accessibility AND ITS CHECKED.
I can see that Automator is added to Security & Privacy > Full Disk Access AND ITS CHECKED.
I can see nothing in the Security & Privacy > Automation pane.
I don't see my QuickAction anywhere, nor am I able to add it anywhere.
I need the procedure to add my QuickAction to the appropriate section to satisfy the security requirement please.
Put your TARGET app in the Security & Privacy > Accessibility section, like if you are gonna run that workflow in Chrome, then put Chrome in the Security & Privacy > Accessibility (simply drag the Chrome.app file into the window).
That works for me!
Check if Automator is allowed to control Bluetooth (same menu Security&Privacy). Worked for me. I never seen this "Watch me do" warning after that.
Check the list of apps in the "Accessibility" area of Security and Privacy. At least one of the apps that are unchecked will need to be checked. This is because after giving you the pop up error message, MacOS adds the needed app(s) to the list of apps allowed to "control your computer". But you have to manually check mark it yourself, because it is only added to the list, but not checked. (Note: not all the apps in this list need to be checked, just the one's relevant to your workflow.)
It's a confusingly worded popup message. Note that we can't even create a "Watch Me Do" until after Automator is given "Accessibility". (This may be confirmed by unchecking Automator in Accessiblity, and then trying to record a "Watch Me Do".) So, even before we are able to record a "Watch Me Do", Automator has Accessibility. Which means, the pop up message you are seeing is not referring to Automator, but to another app.
For example, if your "Watch Me Do" included a click of the menu at the top your Mac's screen, then you would have to give the "Finder" app "Accessibility" too.
To expand the example, I created a "Quick Action" to "Launch Application", and then "Watch Me Do". During the recording of "Watch Me do" I clicked on "File" in the menu at the top of the Mac screen. This menu click was performed not while Finder was the selected app, but while the launched app was selected, so it did not say "Finder" in the upper left corner of my screen, but rather had the "App Name" in the upper left corner of my screen. I was not required to add Accessibility for the app that was launched, but I was required to add Accessibility for Finder. (Edit: I discovered if the app being launched is already launched before running the workflow, then this example required me to give the launched app Accessiblity. Go figure.) ​
Note: if you had created an "Application" instead of a "Quick Action" then you would also have to give the application you made with Automator to have "Accessibility."
I've found that making your changes in the Security & Privacy > Accessibility section, and keeping the lock unlocked when quitting, ensures that the workflow operates as desired.

QAF Reports are not populated in dashboard.htm

Got the latest code here: https://github.com/infostretch/qaf-report.
Extracted dashboard directory & dashboard.htm to the project root directory.
Ran QAF tests.
Opened dashboard.htm during test run & also after test run.
Tried to open dashboard.htm in Google Chrome, Firefox & Safari after giving permissions to access local files. But Dashboard.htm did not load anything. A spinning icon is displayed continously even after several minutes.
Am I missing anything here?
If you are accessing reports locally as file protocol, browser may have restriction to access local files. In such case follow the steps to allow local file access from file for the browser you are using.
Firefox:
go to about:config
set security.fileuri.strict_origin_policy:false.
Safari:
Click on the Develop menu in the menu bar.
Select Disable Local File Restrictions.
If develop menu is not available, Click on the Edit > Preferences > Advanced tab. Check "Show Develop menu in the menu bar.
chrome:
Close down your Chrome browser (make sure you close all instances if you have multiple windows open)
Go to Run and type the following command: chrome.exe --allow-file-access-from-file.
Hit enter.
Reference from local-report-access
I just want to give more clarity by making little corrections to the existing steps mentioned here:
https://github.com/infostretch/qaf-report#local-report-access
When you are opening report "dashboard.htm" from local file system, your browser may have local file access restrictions.
In that case, you can do following setings:
Firefox:
Enter "about:config" in the browser url field & click on the button "Accept the Risk & Continue".
In the "search preference name" field, enter "security.fileuri.strict_origin_policy" & click Enter & click on the toggle button towards the right to set it FALSE.
Safari:
Click on the Develop menu in the menu bar.
Select Disable Local File Restrictions.
If develop menu is not available,
1. Click on the Safari > Preferences > Advanced tab(in MAC, Safari > Preferences > Advanced tab).
2. Check "Show Develop menu in the menu bar.
Chrome:
In Windows PC:
Close down your Chrome browser (make sure you close all instances if you have multiple windows open)
Go to Run and type the following command: chrome.exe --allow-file-access-from-file.
In MAC
Open your terminal anywhere, make sure Google Chrome is currently not running, copy paste this line and hit enter:
open /Applications/Google\ Chrome.app --args --allow-file-access-from-files

Electron JS kiosk mode with touch screen

We are working on a customer facing electron app which should run in kiosk mode. The application runs on a touch enabled device with windows 10.
Even when the app is in kiosk mode, users can easily get into the OS by using the swipe gestures (Swipe left and Swipe right) of the OS.
What is the ideal way to lock down the app and prevent users from interacting with the OS?
There doesn't appear to be a way to disable touch screen gestures in Windows 10.
If you don't need the full node integration offered in electron, ie. your app could run entirely in Chrome you can run it from a cheap Android dongle and lock it down much more easily. I've done this a few times and there are apps which let you add a password, etc.
Alternatively, you could listen for the blur event on your BrowserWindow which is fired when your app loses focus. At that point you may be able to set it into the foreground again:
const mainWindow = require('electron').remote.getCurrentWindow();
mainWindow.on('blur', () => {
mainWindow.restore();
mainWindow.focus();
mainWindow.setKiosk(true);
});
I was able to disable touchscreen gestures for edge of screen by editing a group policy value:
RUN gpedit.msc from the Run box
Computer Configuration > Administrative Templates > Windows Components > EdgeUI > Allow Swipe: DISABLE
A method I've used since Windows 8, is to kill the explorer.exe process shortly after login. Achieved with a scheduled task, set to run 20-30 seconds after login, with a command like this:
taskkill /F /IM explorer.exe
If you need to work on the system, remote in or connect a keyboard and send CTRL + ALT + Del to bring up Task Manager. Go to File > Run new task. In the Create new task dialogue, enter explorer and hit Enter.
When done, reboot the system and all is back to normal.
What I've done to disable the swipe functionality of Windows is to launch our kiosk application instead of explorer.exe.
So, we often deal with multiple displays and many of our apps are written for chrome browser. That means an automated kiosk will have to run a script that launches full screen incognito/kiosk browser instances on two or more displays. We use AutoHotkey to automate the placement and fullscreening of displays, as well as running a watchdog script that monitors for possible browser crashes and popups.
Unintended defocusing by the OS is the last thing we want.
Anyway, to replace the explorer with your app, I've found this regedit to work:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="D:\\path\\to\\your\\appFile.bat"
Copy that into a .txt file, rename the extension to .reg and run it.
To revert:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="explorer.exe"
Since windows cannot run an .ahk file, we just run a .bat file that runs .ahk file, that in turn runs all the browsers and does all the other initialization magic.
For remote work, we do the same as user Bink mentioned: bring up run dialog and run explorer.exe. When done, reboot.
If you have windows Home and you don't have gpedit.msc
(even if you can install using https://www.itechtics.com/enable-gpedit-windows-10-home/)
I found this working solution:
https://www.tenforums.com/tutorials/48507-enable-disable-edge-swipe-screen-windows-10-a.html

How do I enable and disable Android Nougat's "Work Mode" in Tasker?

How do I enable and disable Android Nougat's "Work Mode" in Tasker? Is there an intent I can send, or a setting I can change (using AutoTools if necessary)?
as I am still waiting for my s7 to get an OTA update to Nougat, I can only guess here as I did not have a possibility to tinker with that setting.
From what I could gather so far on the Internet there does not seem to be any Intent to switch on/off work mode. In that case your only option would be to automate the process of going into settings and clicking that option. You could use AutoInput for that

Access an iPads Device Settings using UIAutomation

Can you access the iPad Device settings using the UIAutomation instrument?
I can use deactivateAppForDuration, but that does not allow me to exit the app navigate to the settings page, change a setting, and navigate back to the app and move on.
any suggestion?
No, you cannot automate anything outside of the target application as of right now. When your app leaves the foreground the automation tool loses control until it returns (if it does at least).

Resources