[
https://issues.apache.org/jira/browse/CB-7978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223541#comment-14223541
]
ASF GitHub Bot commented on CB-7978:
------------------------------------
Github user mmocny commented on a diff in the pull request:
https://github.com/apache/cordova-browser/pull/4#discussion_r20823525
--- Diff: bin/templates/project/cordova/run ---
@@ -20,10 +20,33 @@
*/
var shell = require('shelljs'),
- spawn = require('child_process').spawn,
- project = 'file://' + shell.pwd() +
'/platforms/browser/www/index.html';
+ fs = require('fs');
+var configFile = shell.pwd() + '/config.xml';
+var configXML = fs.readFileSync(configFile, 'utf8');
+var sourceFile = /<content[\s\S]*?src\s*=\s*"(.*?)"/i.exec(configXML);
+var spawn = require('child_process').spawn,
+ tmpDir = '/tmp/temp_chrome_user_data_dir_for_cordova_browser/',
+ project = 'file://' + shell.pwd() + '/platforms/browser/www/' +
sourceFile[1];
+
+fs.mkdir(tmpDir);
switch (process.platform) {
+ case 'linux':
+ var args = ['--disable-web-security',
'--user-data-dir=/tmp/temp_chrome_user_data_dir_for_cordova_browser', project];
+ var chromeProcess = spawn('chrome', args);
+
+ chromeProcess.on('close', function(code) {
+ if (code != 0) {
--- End diff --
The other platforms don't do output redirection. If you think this is a
good idea, please consider moving it out to a separate PR. I wouldn't want
each platform to do something different.
> Can't run browser platform on Linux
> -----------------------------------
>
> Key: CB-7978
> URL: https://issues.apache.org/jira/browse/CB-7978
> Project: Apache Cordova
> Issue Type: Bug
> Components: Browser
> Affects Versions: 4.0.0
> Environment: Linux
> Reporter: Victor Adrian Sosa Herrera
>
> Command "cordova run browser" doesn't work on Linux. The run command handles
> the cases of when using Windows and Darwin (MacOS) but no Linux.
> Moreover, I have Chrome installed in my machine, but it doesn't respond to
> the typical "chrome" command because I get an error in the standard
> output[1], so I have to use "google-chrome" command to launch it
> One more thing I noticed is that in the run script of the browser platform,
> it is directly pointing to "www/index.html", instead of reading config.xml
> file looking for <content src="HTMLPage.html">
> [1] Error
> chrome: error while loading shared libraries: libudev.so.0: cannot open
> shared object file: No such file or directory
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]