summary refs log tree commit diff
path: root/resources/app/lib/static/preload.js.map
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-08-19 12:17:51 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-08-19 12:17:51 +0200
commitea7016bdb1d9fb7de1a66a94b3de3b3c9e0f32c9 (patch)
tree22a6413c757bb2cc709a51f851d5718298430c0d /resources/app/lib/static/preload.js.map
download9anime-client-ea7016bdb1d9fb7de1a66a94b3de3b3c9e0f32c9.tar.gz
9anime-client-ea7016bdb1d9fb7de1a66a94b3de3b3c9e0f32c9.tar.bz2
9anime-client-ea7016bdb1d9fb7de1a66a94b3de3b3c9e0f32c9.zip
Initial Commit HEAD master
Diffstat (limited to 'resources/app/lib/static/preload.js.map')
-rw-r--r--resources/app/lib/static/preload.js.map1
1 files changed, 1 insertions, 0 deletions
diff --git a/resources/app/lib/static/preload.js.map b/resources/app/lib/static/preload.js.map
new file mode 100644
index 0000000..bcc57e4
--- /dev/null
+++ b/resources/app/lib/static/preload.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["preload.js"],"names":["document","addEventListener","injectScripts","INJECT_JS_PATH","path","join","__dirname","log","require","setNotificationCallback","createCallback","clickCallback","OldNotify","window","Notification","newNotify","title","opt","instance","requestPermission","bind","Object","defineProperty","get","permission","needToInject","fs","existsSync","notifyNotificationCreate","ipcRenderer","send","notifyNotificationClick","on","event","message","appArgs","JSON","parse","info"],"mappings":";;AAgBA;;AACA;;;;AACA;;;;;;AAlBA;;;;AAIA;;;;AAIAA,SAASC,gBAAT,CAA0B,kBAA1B,EAA8C,YAAM;AAClD;AACA;AACA;AACAC;AACD,CALD;;AAOA;AACwC;AACf;AACJ;;AAErB,IAAMC,iBAAiBC,eAAKC,IAAL,CAAUC,SAAV,EAAqB,QAArB,EAA+B,kBAA/B,CAAvB;AACA,IAAMC,MAAMC,QAAQ,UAAR,CAAZ;AACA;;;;;;;AAOA,SAASC,uBAAT,CAAiCC,c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AAC1C;AACA3B,MAAI+B,IAAJ,CAAS,QAAT,EAAmBJ,OAAnB;AACD,CAHD","file":"preload.js","sourcesContent":["/**\n Preload file that will be executed in the renderer process\n */\n\n/**\n * Note: This needs to be attached prior to the imports, as the they will delay\n * the attachment till after the event has been raised.\n */\ndocument.addEventListener('DOMContentLoaded', () => {\n  // Due to the early attachment, this triggers a linter error\n  // because it's not yet been defined.\n  // eslint-disable-next-line no-use-before-define\n  injectScripts();\n});\n\n// Disable imports being first due to the above event attachment\nimport { ipcRenderer } from 'electron'; // eslint-disable-line import/first\nimport path from 'path'; // eslint-disable-line import/first\nimport fs from 'fs'; // eslint-disable-line import/first\n\nconst INJECT_JS_PATH = path.join(__dirname, '../../', 'inject/inject.js');\nconst log = require('loglevel');\n/**\n * Patches window.Notification to:\n * - set a callback on a new Notification\n * - set a callback for clicks on notifications\n * @param createCallback\n * @param clickCallback\n */\nfunction setNotificationCallback(createCallback, clickCallback) {\n  const OldNotify = window.Notification;\n  const newNotify = (title, opt) => {\n    createCallback(title, opt);\n    const instance = new OldNotify(title, opt);\n    instance.addEventListener('click', clickCallback);\n    return instance;\n  };\n  newNotify.requestPermission = OldNotify.requestPermission.bind(OldNotify);\n  Object.defineProperty(newNotify, 'permission', {\n    get: () => OldNotify.permission,\n  });\n\n  window.Notification = newNotify;\n}\n\nfunction injectScripts() {\n  const needToInject = fs.existsSync(INJECT_JS_PATH);\n  if (!needToInject) {\n    return;\n  }\n  // Dynamically require scripts\n  // eslint-disable-next-line global-require, import/no-dynamic-require\n  require(INJECT_JS_PATH);\n}\n\nfunction notifyNotificationCreate(title, opt) {\n  ipcRenderer.send('notification', title, opt);\n}\nfunction notifyNotificationClick() {\n  ipcRenderer.send('notification-click');\n}\n\nsetNotificationCallback(notifyNotificationCreate, notifyNotificationClick);\n\nipcRenderer.on('params', (event, message) => {\n  const appArgs = JSON.parse(message);\n  log.info('nativefier.json', appArgs);\n});\n\nipcRenderer.on('debug', (event, message) => {\n  // eslint-disable-next-line no-console\n  log.info('debug:', message);\n});\n"]}
\ No newline at end of file