-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathpage-init.js
1 lines (1 loc) · 1.06 KB
/
page-init.js
1
try{document.addEventListener("dragstart",function(o){o.preventDefault()}),document.addEventListener("drop",function(o){o.preventDefault()}),document.addEventListener("dragover",function(o){o.preventDefault()}),document.addEventListener("contextmenu",function(o){o.preventDefault(),o.stopPropagation()}),document.addEventListener("keydown",function(o){8===o.keyCode&&o.target===document.body&&(o.preventDefault(),o.stopPropagation())}),window.onload=function(){document.body.onscroll=function(){document.body.scrollLeft=0,document.body.scrollTop=0}},window.onunload=function(){Editor&&Editor.Panel?Editor.sendToCore("window:save-layout",Editor.Panel.getLayout(),Editor.requireIpcEvent):Editor.sendToCore("window:save-layout",null,Editor.requireIpcEvent)},window.onerror=function(o,e,n,t,r){return Editor&&Editor.sendToWindows?Editor.sendToWindows("console:error",{message:r.stack||r}):console.error(o),!1}}catch(error){window.onload=function(){var o=require("remote"),e=o.getCurrentWindow();e.setSize(800,600),e.center(),e.show(),e.openDevTools(),console.error(error.stack||error)}}