Merge pull request #2148 from ethereum/closeIfElectron

Let close the window if electron
pull/1/head
yann300 5 years ago committed by GitHub
commit f356cd5e3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      package.json
  2. 9
      src/app.js

@ -36,6 +36,7 @@
"fast-async": "^7.0.6", "fast-async": "^7.0.6",
"fast-levenshtein": "^2.0.6", "fast-levenshtein": "^2.0.6",
"gists": "^1.0.1", "gists": "^1.0.1",
"is-electron": "^2.2.0",
"javascript-serialize": "^1.6.1", "javascript-serialize": "^1.6.1",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"js-base64": "^2.1.9", "js-base64": "^2.1.9",
@ -58,6 +59,7 @@
"request": "^2.83.0", "request": "^2.83.0",
"rimraf": "^2.6.1", "rimraf": "^2.6.1",
"selenium-standalone": "^6.0.1", "selenium-standalone": "^6.0.1",
"semver": "^6.1.2",
"solc": "^0.5.0", "solc": "^0.5.0",
"standard": "^8.5.0", "standard": "^8.5.0",
"swarmgw": "^0.3.1", "swarmgw": "^0.3.1",
@ -68,8 +70,7 @@
"web3": "1.0.0-beta.27", "web3": "1.0.0-beta.27",
"webworkify": "^1.2.1", "webworkify": "^1.2.1",
"yo-yo": "^1.2.2", "yo-yo": "^1.2.2",
"yo-yoify": "^3.7.3", "yo-yoify": "^3.7.3"
"semver": "^6.1.2"
}, },
"dependencies": { "dependencies": {
"http-server": "^0.11.1", "http-server": "^0.11.1",

@ -1,6 +1,7 @@
/* global localStorage */ /* global localStorage */
'use strict' 'use strict'
var isElectron = require('is-electron')
var $ = require('jquery') var $ = require('jquery')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
var yo = require('yo-yo') var yo = require('yo-yo')
@ -259,9 +260,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
if (window.location.protocol.indexOf('https') === 0) { if (window.location.protocol.indexOf('https') === 0) {
toolTip('You are using an `https` connection. Please switch to `http` if you are using Remix against an `http Web3 provider` or allow Mixed Content in your browser.') toolTip('You are using an `https` connection. Please switch to `http` if you are using Remix against an `http Web3 provider` or allow Mixed Content in your browser.')
} }
// Oops! Accidentally trigger refresh or bookmark. if (!isElectron()) {
window.onbeforeunload = function () { // Oops! Accidentally trigger refresh or bookmark.
return 'Are you sure you want to leave?' window.onbeforeunload = function () {
return 'Are you sure you want to leave?'
}
} }
let appStore = new EntityStore('module', 'name') let appStore = new EntityStore('module', 'name')

Loading…
Cancel
Save