Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate "monkey patching browser platform to disable browser pop-up" (Browser + Sauce) #170

Open
janpio opened this issue Jun 29, 2019 · 1 comment

Comments

@janpio
Copy link
Member

janpio commented Jun 29, 2019

} else if (this.isBrowser && this.config.shouldUseSauce()) {
logger.info('cordova-paramedic: I like patching stuff, so...');
logger.info('cordova-paramedic: monkey patching browser platform to disable browser pop-up.');
let cordovaRunFile = path.join(this.tempFolder.name, 'platforms', 'browser', 'cordova', 'run');
// we need to supply some replacement string so this method can properly return a result
if (appPatcher.monkeyPatch(cordovaRunFile, /return cordovaServe\.launchBrowser\(.*\);/, '// no pop-up please')) {
logger.info('cordova-paramedic: success!');
this.runner.browserPatched = true;
} else {
cordovaRunFile = path.join(this.tempFolder.name, 'platforms', 'browser', 'cordova', 'lib', 'run.js');
if (appPatcher.monkeyPatch(cordovaRunFile, /return server\.launchBrowser\(\{'target': args\.target, 'url': projectUrl\}\);/, '// no pop-up please')) {
logger.info('cordova-paramedic: success!');
this.runner.browserPatched = true;
} else {
logger.info('cordova-paramedic: couldn\'t apply the patch. Not a big deal, though: things should work anyway.');
this.runner.browserPatched = false;
}
}
}

Not sure what exactly this does and if it is still needed.

@janpio
Copy link
Member Author

janpio commented Jun 29, 2019

Doesn't seem to work at least:
https://travis-ci.org/apache/cordova-paramedic/jobs/552161338

cordova-paramedic: successfully finished adding platform browser
cordova-paramedic: I like patching stuff, so...
cordova-paramedic: monkey patching browser platform to disable browser pop-up.
cordova-paramedic: couldn't apply the patch. Not a big deal, though: things should work anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant