Set Chrome as default browser using Grunt Connect and Grunt Open - gruntjs

I use Safari as default browser on my OS X but I want use Chrome as default for Grunt connect and watch so i follow the steps i found on this blog. Everything ok if i set 'Google Chrome Canary' or 'Firefox' as 'app' parameter in grunt open options but if i try to use 'Google Chrome' a virtualized app on Chrome starting on Parallel's Windows version! How can I say to grunt to use not Google Chrome on Parallels but on my Mac OS X?

Looking at open's source on line 31 it opens using this code:
opener = 'open -a "' + escape(appName) + '"';
Try using the full path to the chrome you want to use as the app parameter for the grunt task. You can play around with it from the terminal by entering in open -a /some/path/to/chrome so you do not have to run the whole grunt task.

Related

'geckodriver' executable needs to be in PATH on Mac with Eclipse RED

I've been trying to automate some basic stuff with Robotframework. Here is my configuration.
Python - 2.7.10
MAC High Sierra 10.13.2
Eclipse Oxygen with RED Editor
I've downloaded Geckodriver executable and put in under several places including usr/local/bin, folder on desktop
Here is what i've tried
Setup FFDriver Set Environment Variable webdriver.gecko.driver Users/[my username]/Desktop/geckodriver
Setup FFDriver Set Environment Variable webdriver.gecko.driver usr/local/bin/geckodriver
and my test
open browser http://www.google.com firefox
I've added usr/local/bin in PATH as well and still getting "geckodriver executable needs to be in PATH" error. The same happens with Chromedriver too. I am sure I must be missing something trivial here, can someone help me out please?
Launching the eclipse from command prompt, has fixed this issue. Yes, the PATH is not being inherited when launched from desktop icon.
when you use Python. the best shortcut you can do is, put you 'geckodriver.exe' file in pythons script folder. and set the Script folder path in you system path. this will resolve your problem.

How can I use grunt to open Google Chrome and pass flags like --incognito?

I am using grunt-contrib-connect for a local dev server and want to write a task to launch google chrome after server starts. But want to pass following arguments to open it in insecure mode.
--args --disable-web-security --user-data-dir
I tried grunt-open to do that but didn't find any options to pass flags.
Any help is appreciated.
You should be able to use grunt-exec to do what you need. A configuration like this works for me:
grunt.config.init({
...
exec: {
chrome: {
cmd: '"C:/Program Files (x86)/Google/Chrome/Application/chrome" --incognito http://washingtonpost.com'
}
}
...
});
Note that, on Windows, quotes are required around the path to the executable. If you're fortunate enough to be using less annoying OS, you won't need them.

How to debug a Meteor plugin file?

I've followed Meteor Doc to register a plug-in package.
Created a plug-in file in the package/plugin/ folder
Added a debugger; in that file.
ran $ meteor debug;
Problem: debugger; directive is ignored. How to debug the plug-in file?
Thx!
plugin/compile-atscript.js:
Plugin.registerSourceHandler(
'ats'
, function (compileStep) {
var source = compileStep.read().toString('utf8');
console.log('source: ' + source);
debugger;
console.log('compiled source: ' + source);
});
The Meteor tool runs build plugins in-process, so you just need to run it under the debugger. On Linux and Mac OS X, the launcher script supports a TOOL_NODE_FLAGS variable that can be used to pass arguments to the Node.js runtime to enable debugging. See the instructions for debugging the Meteor tool, although these are geared toward use with a git checkout of Meteor. A hacky shortcut:
METEOR_INSTALLATION=~/.meteor/packages/meteor-tool/$(meteor --long-version | sed -ne 's/^meteor-tool#//p')/mt-$(meteor --arch)
TOOL_NODE_FLAGS=$METEOR_INSTALLATION/dev_bundle/lib/node_modules/node-inspector/bin/node-debug.js $METEOR_INSTALLATION/meteor
(Note, using just meteor on the last line may not work because when the default version of the Meteor tool executes the proper version for the app, the debugger would be started a second time.)
On Windows, support for TOOL_NODE_FLAGS was added to the launcher script in Meteor 1.4.4. If the app is using an older version of Meteor, one could manually edit the launcher script. The commands to start debugging would look like:
set METEOR_INSTALLATION=%LOCALAPPDATA%\.meteor\packages\meteor-tool\TOOL_VERSION\mt-os.windows.x86_32
set TOOL_NODE_FLAGS=%METEOR_INSTALLATION%\dev_bundle\lib\node_modules\node-inspector\bin\node-debug.js
%METEOR_INSTALLATION%\meteor.bat
(Someone else is welcome to add copy-and-pasteable code to figure out the correct TOOL_VERSION!)
On macOS
Set Environment variable
export TOOL_NODE_FLAGS="--inspect-brk"
List env vars
printenv
Run meteor
meteor
Debugger will be listening and will get attached to Chrome dev tools on opening the Chrome Browser.

Ionic framework - command 'grunt serve' returns 'multiple addresses available' and freezes

Used Yeoman ionic-generator
https://github.com/diegonetto/generator-ionic
Where I ran it without sass, default plugin list and blank.
And when running grunt serve I get the following:
Multiple addresses available.
Please select which address to use by entering its number from the list below:
1) 192.168.1.69 (en0)
2) localhost
Address Selection:
When I type 2 in terminal and return it just hangs there without going further or launching a browser.
I have tried also typing localhost or 'localhost' and returning, still nothing it just hangs...
I am so confused to why?
Any help on the matter would be most appreciated, thank you.
This morning i ran in the same problem as you did. I look into the Ionic serve code (.\node_modules\ionic\lib\ionic\serve.js) and compared it with another file, i didnt found any difference.
So instead using the "grunt serve" command i tried the "ionic serve" command. This script the didn't hang in the commandline so i could select an address. (in my case i selected 2 (the localhost)).
From this point it remembers the option you selected. so you can run "grunt serve" command again.
If the command "ionic serve" isn't working try to install ionic: "npm install -g ionic"
Edit the file ionic.config in: (Mac) ~/.ionic or (Win) c:/users/username/.ionic
add: "ionicServeAddress": "localhost" to the config file
It will choose local host automatically and then "grunt serve" will not ask you for an address.
I found the solution here: https://stackoverflow.com/a/26330536/2925856
The reason here is that Grunt Watch is running, it will block the terminal from other works so we cannot do anything when Grunt Watch is running. Maybe you can disconnect internet from the wifi and disconnect all Lan cable connect to your computer to make sure you only have one local ip address and run grunt serve. After that you can connect all these things again. Another solution is that it might need to set time out in serve.js in ionic lib to auto assign the selection for us or event remove the step of choosing Multiple IP Selection by auto assign to localhost.

Meteor examples cannot run on OS X: browser just download a file

Whenever I run the provided example: leaderboard, todos. After typing the address: localhost:3000, the browser just download a file called "download". Any ideas?
The terminal says everything is OK:
$ meteor
[[[[[ ~/Dropbox/Projects/JavaScript/meteor/todos ]]]]]
Running on: http://localhost:3000/
Both Chrome and Safari give me the same result: downloading a file.
It's probably because you're running it inside the Dropbox folder. Move it to a different location and it should work.
I'm guessing that the issue is that the mime type is being set by the Dropbox program instead of it being handled by the node.js server on your machine.

Resources