Chrome nativeMessaging example fails on Windows - google-chrome

I downloaded the official Chrome nativeMessaging example to test it out.
To do this, I installed the app from chrome://extensions, by choosing Load Unpacked. No problems so far.
I then installed the host. I'm using Windows 7, so I ran install_host.bat, which claimed that "The operation completed successfully." However, when I go to chrome://apps/ and click the Connect button, I get this error:
Failed to connect: Native host has exited.
Is there some reason this would happen? Restarting Chrome did not fix the issue, nor did uninstalling and then reinstalling the host program.
(I noticed that native-messaging-example-host.bat requires Python 2, so I modified it to run Python 2 explicitly. If I run native-messaging-example-host.bat from the command line, it pops up a little example program of its own with a GUI and seems to work correctly.)

Turns out I was using a non-standard character in the path leading to the host executable. This wouldn't be a problem for any other program, but Chrome's native messaging API doesn't like it, I guess.
By the way, the documentation on setting up this example is near-nonexistent, but this stack overflow link has some useful info: Chrome Extension NativeMessaging 'connectNative' undefined

Related

While using Selenium and chromedriver in JMeter, I get an error on chrome

I have inherited a JMeter performance testing script. There is a chromedriver section and an HTTPSampler section. The httpsampler section works fine. The chromedriver section runs into a problem. When I run it chrome pops up like this:
It does not move forward with any of the steps in the plan after that. Up until recently I've also been seeing the error
Error communicating with the remote browser. It may have died.
I am not seeing this now, so I don't know if it's just a difference in how the test is running or what.
The person I inherited this from was running it on a mac and did not get any of these problems. I saw it run with no errors at the same time I was getting them.
One solution I found was to add the --test-type flag to chromedriver. Unfortunately I cannot find a way to add that argument when running it through JMeter. I've tried adding both --test-type and -test-type to the end of the path to chromedriver.exe, but that did not work.
Does anyone have a solution for this?
The error might be due to conflict in chrome driver version. Please install the latest version of ChromeDriver from this link.
Latest version of Chrome Driver supports the browser version v56-58.

dyld fatal error when running XCUITest

I get a dyld fatal error as xcode attempts to initiate the UI test suite.
dyld: Library not loaded: #rpath/XCTest.framework/XCTest
Referenced from: /var/mobile/Containers/Bundle/Application/9A03F81B-1A93-4F0E-88B0-56C0748D1D43/ExampleUITests-Runner.app/XCTRunner
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/9A03F81B-1A93-4F0E-88B0-56D0748D1D43/ExampleUITests-Runner.app/Frameworks/XCTest.framework/XCTest: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/9A03F81B-1A93-4F0E-88B0-56D0748D1D43/ExampleUITests-Runner.app/Frameworks/XCTest.framework/XCTest'
So I'm running this on a Mac Mini which is a designated testing workstation. I have the same identical project on my macbook and it runs fine. I tried deleting my project and re-cloning it and it still goes through the same issue.
Any ideas on what the issue may be?
On a side note, I had this issue before. My solution was doing a re-format since re-installing Xcode and recloning my project from github did not fix the issue.
Error seems to suggest that Xcode is not able to locate XCTest.framework on your mac mini.Did you try adding $(PLATFORM_DIR)/Developer/Library/Frameworks to Framework Search Path of your UI Test Target.
You can also test adding XCTest.framework as a Build Phases Dependency.
It turned out it was an error regarding my certificates and this issue was resolved by revoking my certificates and resetting all of them.
Then I had to remove the problem apps from my device from Window > Devices and that allowed me to run my tests.

PNaCl and Google Chrome 40 on Linux: Compile process could not be created

I am trying to run the part1 application in the getting_started directory of the Google Native Client SDK, and I obtain the following message in my browser:
NativeClient: PnaclCoordinator: Compile process could not be created:
When I visit the http://localhost:5103 I see the string "Loading...", but it never changes to "Success".
What do I need to configure in Chrome in order to be able to use Native Client applications?
My setup:
OS: Ubuntu Linux 12.04 LTS
Browser: Google Chrome 40
Pepper: 39
Root access: no
Not an answer, but a question:
Can you try to get some more log messages out of chrome or the NaCl runtime?
Start chrome from the shell with the environment variable NACLVERBOSITY=4 set. That asks chrome to show what is going on in the NaCl runtime when it has created a NaCl process (for the compiler). Typical messages are something like:
Entered NaClCreateServiceSocket
...
NaClSetUpBootstrapChannel
...
Elf header
...
and some more details. If that shows up, we know that NaCl compiler process creation at least made it that far. Could you then post the log somewhere, and I can take a look?
If it doesn't show up, then the problem is earlier in chrome. In this case, running chrome w/ --enable-logging=stderr -v1 (http://www.chromium.org/for-testers/enable-logging) might give some idea of what is going on in chrome before NaCl process creation.
Same issue.
I changed the chrome://flags settings for NaCl for debugging but we are not using the NaCl debugger at all. I set it back to default and it started working. (So I guess that was the problem?)

run chrome 30 without sandbox

I'm trying to run chrome 30, in Linux, from the command line (executing google-chrome file of the version downloaded and unpacked in a folder).
If i run it without the option --no-sandbox the result is the following
[24419:24419:1016/012228:FATAL:zygote_host_impl_linux.cc(142)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/user/user.browsers/chrome-30/opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.
./chrome-30.sh: line 5: 24419 Aborted (core dumped) $CHROME_FOLDER/google-chrome
If I run it with the option --no-sandbox, following also this procedure to configure it, the result is the error:
È stata creata una nuova finestra nella sessione corrente del browser.
[1016/012454:ERROR:nacl_helper_linux.cc(269)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
This last procedure works fine with chrome v31.
Any help?
If you have root access, you should set up the SUID sandbox as per these instructions, and run without the --no-sandbox option.
If you don't have root access, you cannot set up a SUID sandbox and you have to use the --no-sandbox option, but only use it for testing because it is a security risk.
In your case, it looks like you tried running a new Chrome window with --no-sandbox while another session was already running (that's what the message in Italian says). Try closing the existing session before starting a new one. To close the existing session, find the Chrome icon in the system tray, right click it and choose Exit. If you don't see the system tray icon, you can also try killall google-chrome or killall chromium, depending on which version you're using.
This error message...
[24419:24419:1016/012228:FATAL:zygote_host_impl_linux.cc(142)] The SUID sandbox helper binary was found, but is not configured correctly.
Rather than run without sandboxing I'm aborting now.
You need to make sure that /home/user/user.browsers/chrome-30/opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.
./chrome-30.sh: line 5: 24419 Aborted (core dumped) $CHROME_FOLDER/google-chrome
...implies that the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
As per the discussion in Issue 400842: Chromium, if you have installed Chromium v35 (or later) and your cpu doesn't have the SSE2 instruction set, e.g. AthlonXP, Pentium III, etc, then Chromium can't be initiated successfully. All the new Chromium browsers from version 35 onwards need SSE2. Any Chromium version earlier than 35 should run on such a system without any issue.
To enforce these measures, Chromium team have closed the issue as Status: WontFix and mentioned:
If you really want to build Chromium without SSE2, you are welcome to apply your own patches and build your own browser however you like, but the Chromium project is not accepting patches to build without SSE2.
Further, this feature was successfully tested in AMD Athlon 3400+ desktop with Lubuntu 14.04.2 and Chrome seems to work fine. But on an older AMD Athlon 1300 without SSE, Chrome now courteously displays a message that "my hardware does not support it".
In mac you can run the below command to run the chrome in sandbox mode. This will open the chrome and supress the security settings. This can be used for testing API's etc from angular or ionic
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --user-data-dir=$HOME/chrome-in-sandbox-mode

Chrome: Attaching nacl-gdb to packaged application loaded as an unpacked extension

I have built a simple NaCl application. For running the application I use technique 2 described in Nacl Developer's guide, which means that instead of running a local server I load my application as unpacked extension to chrome. The application runs fine so far.
Now I want to experiment with nacl-gdb and attach my application to it at startup.
In the NaCl Developer's guide there are only instructions on how to attach nacl-gdb on an application that is run with local server(technique 1). I made a search to the internet and I ended up with the following approach in order to attach nacl-gdb for an application that is being ran with technique 2:
I enabled "Native Client GDB-based debugging" flag of Chrome.
I started chrome from a terminal like this: ./chrome "--nacl-gdb=gnome-terminal --
/media/sdb1/leonidasbo/AncientRoot/nacl_sdk/pepper_27/toolchain/linux_x86_glibc/bin/x86_64-nacl-gdb"
When Chrome launched, I navigated to my application.
With this approach, Chrome automatically started nacl-gdb when I opened my application.
However nacl-gdb tried to attach but with no success. The output was the following:
*This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=x86_64-nacl".
Reading symbols from /opt/google/chrome/nacl_irt_x86_64.nexe...(no debugging symbols found)...done.
Don't know how to attach. Try "help target".
(gdb)*
It seems that gdb cannot attach to my application. I tried executing "target exec /path/to/my.nexe", but nothing changed.
Am I missing something here? Is there any other way to debug applications loaded as unpacked extensions with nacl-gdb?
My OS is Ubuntu 12.04 and I am using pepper_27 of nacl_sdk. Chrome version is 27.0.1453.93.
Thanks
I assume you were using this guide, which I was using earlier as well. It is out of date. These are the real instructions. It seems that the way you attach the debugger has completely changed, and it is no longer possible to use --nacl-gdb (that is planned for removal). You must manually attach the debugger by following these steps.
The full guide is here, but I'll summarize:
Launch Chrome with chrome --enable-nacl --enable-nacl-debug --no-sandbox --disable-hang-monitor.
Run <NACL_SDK_ROOT>/toolchain/win_x86_newlib/bin/x86_64-nacl-gdb (with no arguments).
Enter these commands into the gdb prompt:
(gdb) nacl-manifest <path-to-your-.nmf-file>
(gdb) nacl-irt <CHROME-DIR>/nacl_irt_x86_64.nexe
(gdb) target remote localhost:4014
Now you can use gdb as normal. (If you just want to run the application until it crashes, start by typing continue.)