golang chromedp ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value - google-chrome

I'm getting ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value while fetching amazon using chromedp. Tried with different user-agents but nothing works.
github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 github.com/chromedp/chromedp v0.8.4
Google Chrome 104.0.5112.79

What is wrong
Google Chrome 104.0.5112.79 has such policies (see browser_protocol.pdl#L6178-L6184):
Allow
BlockFromInsecureToMorePrivate
WarnFromInsecureToMorePrivate
PreflightBlock
PreflightWarn
And github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 supports the same list of polices (see cdproto).
So the error looks impossible.
What to do next
The last change to PrivateNetworkRequestPolicy is 97.0.4665.1_9.7.3 which adds two new values:
PreflightBlock
PreflightWarn
Please double check the version of the chromedp/cdproto package and the version of the browser.
Now that Chrome 105 has been released, please upgrade to this version. Maybe it will address the issue.
It will be helpful if you can enable the debug log to record what is the invalid value. Enable the debug log like this:
ctx, cancel := chromedp.NewContext(ctx, chromedp.WithDebugf(log.Printf))

updating chromedp to the latest version fixed the issue.
Refer: https://github.com/chromedp/chromedp/issues/797
go list -m github.com/chromedp/cdproto
github.com/chromedp/cdproto v0.0.0-20221126224343-3a0787b8dd28

Related

DriveApp.setSharing is now throwing an Exception, is there something wrong with the legacy runtime?

The following code was working previously (and still works with the V8 runtime):
function myFunction() {
var file = DriveApp.createFile("Test", "Test");
file.setSharing(DriveApp.Access.DOMAIN_WITH_LINK, DriveApp.Permission.VIEW);
Logger.log(file.getUrl());
}
Now it is throwing the following error:
Invalid argument
I have isolated the issue down to the DOMAIN or DOMAIN_WITH_LINK Access parameter. PRIVATE works fine. ANYONE and ANYONE_WITH_LINK throws a permissions error (which is expected as this user does not have access to share outside the domain).
Unfortunately I cannot update the script to use the V8 runtime due to my use case.
One other thing to note: I get this exact same error with this exact same code when running it in a free Google account. (Could it be an issue with Google's engine recognizing the domain?)
As mentioned by #Cooper there are many issues regarding sharing.
The most recent issue is currently being worked on: https://issuetracker.google.com/issues/161201634
You just have to go there and click on the star next to the title so you get updates on the issue and you give the issue more visibility.

Permission issue for appium chrome borwser

I am implementing an appium test on remote android driver, with chrome browser for loading urls.
Some of the Urls are pdfs, and chrome asks to store those files. and appears that chrome doesnt have access to filesystem to store those files, which results in a dialog like below.
Please help me pass that dialog without any manual inputs.
Upon clicking continue, it will load actual permissions dialog from Android.
Here is my code initialize appium capabilities
DesiredCapabilities caps = DesiredCapabilities.android();
caps.setCapability("appiumVersion", "1.9.1");
caps.setCapability("deviceName","Samsung Galaxy S9 Plus HD GoogleAPI Emulator");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", "Chrome");
caps.setCapability("platformVersion", "8.1");
caps.setCapability("platformName","Android");
caps.setCapability("autoAcceptAlerts", true);
caps.setCapability("autoGrantPermissions", true);
caps.setCapability("chromedriverArgs", "--allow-file-access-from-files");
caps.setCapability("maxDuration", 10000);
and this is the snippet I use to load a Url
driver.navigate().to("http://kmmc.in/wp-content/uploads/2014/01/lesson2.pdf");
autoGrantPermission also doesnt work in this case because chrome is already installed. Appium team has already rejected this issue -
https://github.com/appium/appium/issues/10008
Please help!
Indeed I had very hard time finding out the solution, but eventually I found a workaround.
The best workaround would have been reinstalling the chrome package. I tried that, but I could not start chrome after reinstalling it, as I had no access to shell, and chromedriver complained. So I left that track.
I tried getting hold of adb command or mobile:changePermissions but for that you need to use server flag --relaxed-security while starting the server, and saucelabs doesnt provide any handy interface to start the server with this flag.
The last resort, I found a solution here - https://stackoverflow.com/a/51241899/4675277 . But just that was not sufficient, because it helped me fix chrome alert, but later on it popped up with another alert with allow and deny, for which another solution in the same question helped me. So this is the code I eventually used -
driver.navigate().to("http://kmmc.in/wp-content/uploads/2014/01/lesson2.pdf");
String webContext = ((AndroidDriver)driver).getContext();
Set<String> contexts = ((AndroidDriver)driver).getContextHandles();
for (String context: contexts){
if (context.contains("NATIVE_APP")){
((AndroidDriver)driver).context(context);
break;
}
}
driver.findElement(By.id("android:id/button1")).click();
contexts = ((AndroidDriver)driver).getContextHandles();
for (String context: contexts){
if (context.contains("NATIVE_APP")){
((AndroidDriver)driver).context(context);
break;
}
}
driver.findElement(By.id("com.android.packageinstaller:id/permission_allow_button")).click();
((AndroidDriver)driver).context(webContext);
This helps allow all permissions required.

Service Worker not prompting to be registered - net::ERR_FILE_EXISTS

I browsed through the other threads - there was no concrete answer.
I implemented a service worker for notifcations
http://docs.pushwoosh.com/docs/chrome-web-push
I checked everything - all scripts are in root, the keys are well implemented. However, I do not get prompted to allow notifs.
Console output reads:
GET https://mydomain/service-worker.js net::ERR_FILE_EXISTS
Note: I do have the correct URL (just changed it here).
What causes the service worker error? How do I fix this?
It isn't anything to worry about. See the internal bug report: https://code.google.com/p/chromium/issues/detail?id=541797 the TL'DR is that when Chrome tries to fetch a new SW if there is no change and thus nothing to install it throws this error message to indicate that state. There is nothing that you need to do.

CORS not working with withCredentials=true sync ajax call on chrome

I am trying to make a cross domain ajax sync call with withCredentials=true, i am not getting any error, the browser just got stuck. My chrome version is 40.0.2214.115 m.
I also tried same with latest version (35.0) of firefox and facing same issue " Invalid access error a parameter or an operation is not supported by the underlying object".
What could be the possible reason, any input would be helpful.

Error when reading control container:Microsoft.WindowsAzure.StorageClient.StorageClientException

I am trying to follow the instructions for the Windows Azure Mysql PHP solution Accelerator ( http://code.msdn.microsoft.com/winazuremysqlphp ) and I get the following error in the Fabric UI and Mysql doesn't start. http://www.pastie.org/1297146
Looks like your diagnostics connection string is bogus... check to make sure it's pointing to a valid account and that the key is correct. Or just disable diagnostics by commenting out DiagnosticMonitor.Start(...) (should be in WorkerRole.cs).