mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-26 10:00:50 +08:00
fix(onboarding): fix injected js error and pass N1 version
This commit is contained in:
parent
5108cded87
commit
f5bf41a181
1 changed files with 4 additions and 2 deletions
|
@ -81,7 +81,8 @@ export default class AuthenticatePage extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const webview = ReactDOM.findDOMNode(this.refs.webview);
|
const webview = ReactDOM.findDOMNode(this.refs.webview);
|
||||||
webview.src = `${IdentityStore.URLRoot}/onboarding?utm_medium=N1&utm_source=OnboardingPage`;
|
const n1Version = NylasEnv.getVersion();
|
||||||
|
webview.src = `${IdentityStore.URLRoot}/onboarding?utm_medium=N1&utm_source=OnboardingPage&N1_version=${n1Version}`;
|
||||||
webview.addEventListener('did-start-loading', this.webviewDidStartLoading);
|
webview.addEventListener('did-start-loading', this.webviewDidStartLoading);
|
||||||
webview.addEventListener('did-get-response-details', this.webviewDidGetResponseDetails);
|
webview.addEventListener('did-get-response-details', this.webviewDidGetResponseDetails);
|
||||||
webview.addEventListener('did-fail-load', this.webviewDidFailLoad);
|
webview.addEventListener('did-fail-load', this.webviewDidFailLoad);
|
||||||
|
@ -130,7 +131,8 @@ export default class AuthenticatePage extends React.Component {
|
||||||
const js = `
|
const js = `
|
||||||
var a = document.querySelector('#pro-account');
|
var a = document.querySelector('#pro-account');
|
||||||
result = a ? a.innerText : null;
|
result = a ? a.innerText : null;
|
||||||
document.querySelector('.open-external').addEventListener('click', function(event) {console.log(this.href); event.preventDefault(); return false;})
|
var el = document.querySelector('.open-external');
|
||||||
|
if (el) {el.addEventListener('click', function(event) {console.log(this.href); event.preventDefault(); return false;})}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const webview = ReactDOM.findDOMNode(this.refs.webview);
|
const webview = ReactDOM.findDOMNode(this.refs.webview);
|
||||||
|
|
Loading…
Reference in a new issue