Run AppleScript in Google Chrome SSB

At my work we use webbased timetracking. It runs on an internal server.
To avoid accidently closing the website I have made a SSB using Google Chrome by following these instructions.

But using Google Chrome as an SSB has lost me the ability to run an AppleScript against the webpage.

I have created a test page, if somebody would like to help me.

https://test.skabertrang.dk/test-form/index.html

If you open this in Chrome and run this script:

set myJavascript1 to "document.querySelector(\"body > form > input[type=text]:nth-child(2)\").value = \"Donald\""
set myJavascript2 to "document.querySelector(\"body > form > input[type=text]:nth-child(5)\").value = \"Duck\""

tell application "Google Chrome"
	execute front window's active tab javascript myJavascript1
	execute front window's active tab javascript myJavascript2
end tell

Then the form fields are changed correctly.


If you then create a SSB using the screenshots above named “test.skabertrang.dk” and run this script, which targets the new app.

set myJavascript1 to "document.querySelector(\"body > form > input[type=text]:nth-child(2)\").value = \"Donald\""
set myJavascript2 to "document.querySelector(\"body > form > input[type=text]:nth-child(5)\").value = \"Duck\""

tell application "test.skabertrang.dk"
	execute front window's active tab javascript myJavascript1
	execute front window's active tab javascript myJavascript2
end tell

Then it does not work.


What I would like to achieve is to be able to use AppleScript in a SSB the same way as in Google Chrome.

Does anybody have a solution for this?

Being on a Mac I cannot use your Windows-based method of creating a Site Specific Browser. However, I did try using epichrome which did build a Site Specific Browser for your test web page. Unfortunately, epichrome does not seem to include AppleScript support in the apps it generates.

I think you may need to raise this issue with the Goggle Chrome or epichrome maintainers to see if they can expose the features you require.

Sorry. I am on macOS. The reason for the Windows based screenshots is that it was the one I could find showing it in english. My system is danish and so is Chrome.

I will try to raise the issue with the Chrome developers.