Last active
March 22, 2018 18:56
-
-
Save jookyboi/9c8ac23afbc3d23b33958007d19e388a to your computer and use it in GitHub Desktop.
Revisions
-
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ From Electron's `main.ts`: ``` import { BrowserWindow, ipcMain } from 'electron'; ... ipcMain.on( 'close-paypal', () => { @@ -17,7 +17,7 @@ ipcMain.on( ``` From your content script (I'm using TypeScript): ``` const { ipcRenderer } = require('electron'); ... paypal.Button.render({ -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,6 @@ paypal.Button.render({ ... payment: () => { ipcRenderer.send('close-paypal', ''); // Other logic to trigger payment flow } ... -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ paypal.Button.render({ payment: () => { ipcRenderer.send('close-paypal', ''); // Other logic to trigger payment flow } ... }); -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,17 +23,10 @@ const { ipcRenderer } = require('electron'); paypal.Button.render({ ... payment: () => { ipcRenderer.send('close-paypal', ''); ... } ... }); ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 15 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,5 +20,20 @@ From your content script (I'm using TypeScript): ```typescript const { ipcRenderer } = require('electron'); ... paypal.Button.render({ ... payment: () => { if (Util.isDesktop()) { electronUtil.closePaypalWindow(); } // Note that this always creates a new payment method return paypalCheckoutInstance.createPayment({ flow: 'vault' }); } ... }); ipcRenderer.send('close-paypal', ''); ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ From Electron's `main.ts`: ``` import { BrowserWindow, ipcMain } from 'electron'; ...typescript ipcMain.on( 'close-paypal', () => { @@ -17,7 +17,7 @@ ipcMain.on( ``` From your content script (I'm using TypeScript): ```typescript const { ipcRenderer } = require('electron'); ... ipcRenderer.send('close-paypal', ''); -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ From Electron's `main.ts`: ``` import { BrowserWindow, ipcMain } from 'electron'; ... ipcMain.on( 'close-paypal', () => { @@ -16,7 +16,9 @@ ipcMain.on( ); ``` From your content script (I'm using TypeScript): ``` const { ipcRenderer } = require('electron'); ... ipcRenderer.send('close-paypal', ''); ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,8 @@ ipcMain.on( 'close-paypal', () => { BrowserWindow.getAllWindows().forEach((win) => { // The Paypal window would fail to load contents due to security // restrictions and return an empty URL if (!win.webContents.getURL()) { win.close(); } -
jookyboi revised this gist
Mar 22, 2018 . No changes.There are no files selected for viewing
-
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,5 +17,5 @@ ipcMain.on( From your content script: ``` ipcRenderer.send('close-paypal', ''); ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,5 +17,5 @@ ipcMain.on( From your content script: ``` ipcRenderer.send(channel, data); ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,4 +13,9 @@ ipcMain.on( }); } ); ``` From your content script: ``` ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ import { BrowserWindow, app, ipcMain } from 'electron'; From Electron's `main.ts`: ``` ipcMain.on( 'close-paypal', -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,14 @@ From Electron's `main.js` or `main.ts`: ``` ipcMain.on( 'close-paypal', () => { BrowserWindow.getAllWindows().forEach((win) => { // The Paypal window would fail to load contents due to security restrictions and return an empty URL if (!win.webContents.getURL()) { win.close(); } }); } ); ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 1 addition and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1 @@ From Ele -
jookyboi revised this gist
Mar 22, 2018 . No changes.There are no files selected for viewing
-
jookyboi revised this gist
Mar 22, 2018 . No changes.There are no files selected for viewing
-
jookyboi revised this gist
Mar 22, 2018 . No changes.There are no files selected for viewing
-
jookyboi revised this gist
Mar 22, 2018 . No changes.There are no files selected for viewing
-
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,5 +6,11 @@ function isElectron() : boolean { return window && window.process && window.process.type; } ... export function supportsPopups(ua? : string = getUserAgent()) : boolean { if (isElectron()) { return false; } return !(isIosWebview(ua) || isAndroidWebview(ua) || isOperaMini(ua) || isFirefoxIOS(ua) || isFacebookWebView(ua) || isQQBrowser(ua)); } ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,9 @@ From a clone of the `paylpal-checkout` repo (https://github.com/paypal/paypal-ch `src/lib/device.js`: ``` function isElectron() : boolean { return window && window.process && window.process.type; } ... ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,5 @@ From a clone of the `paylpal-checkout` repo (https://github.com/paypal/paypal-checkout): `src/lib/device.js`: ``` ``` -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,2 @@ From a clone of the `paylpal-checkout` repo (https://github.com/paypal/paypal-checkout): -
jookyboi revised this gist
Mar 22, 2018 . No changes.There are no files selected for viewing
-
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ From a clone of the `paylpal-checkout` repo (https://github.com/paypal/paypal-checkout), open -
jookyboi revised this gist
Mar 22, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ In the `paylpal-checkout` repo, open -
jookyboi created this gist
Mar 22, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ In the `payl