๋ค์ ์ฝ๋๋ ์์๋๋ก ์๋ํฉ๋๋ค(๋ชจ๋ HTTP ์์ฒญ์ด ์ทจ์๋จ).
session.webRequest.onBeforeRequest({
urls: ['http://*/*']
}, (details, cb) => {
cb({cancel: true})
})
๊ทธ๋ฌ๋ redirectUrl
๊ฐ ์ง์ ๋๋ฉด ์์ฒญ์ด ์ทจ์๋๊ณ ๋ฆฌ๋๋ ์
๋๋ ๋์ ๊ณ์ ์ ์ก๋ฉ๋๋ค.
session.webRequest.onBeforeRequest({
urls: ['http://*/*']
}, (details, cb) => {
cb({redirectUrl: 'https://example.com'})
})
๋๋ ์ ์ ๋ด์ฅํ 0.36.3์ ์ฌ์ฉ ์ค์ ๋๋ค.
์คํ๊ฐ ์์ต๋๋ค. redirectURL
์ด์ด์ผ ํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ์ฌ์์ฐํ ์ ์์ต๋๋ค.
session.webRequest.onBeforeRequest({
urls: ['http://*/*']
}, (details, cb) => {
cb({redirectURL: 'https://example.com'})
})
:ํ์ด์คํ:
๋ง์์, ํด๊ฒฐํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
FWIW, ๋ด ํผ๋์ ๊ทผ์์ ์๋ WebRequest ํด๋์ค์ API๋ (https://developer.chrome.com/extensions/webRequest)๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์์ต๋๋ค redirectUrl
๋์ redirectURL
. ์ด๋ก ์ธํด Chrome ํ์ฅ ํ๋ก๊ทธ๋จ์ Electron์ผ๋ก ์ด์ํ๋ ค๋ ๋ค๋ฅธ ๊ฐ๋ฐ์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
FWIW, ๋ด ํผ๋์ ๊ทผ์์ ์๋ WebRequest ํด๋์ค์ API๋ (https://developer.chrome.com/extensions/webRequest)๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์์ต๋๋ค
redirectUrl
๋์redirectURL
. ์ด๋ก ์ธํด Chrome ํ์ฅ ํ๋ก๊ทธ๋จ์ Electron์ผ๋ก ์ด์ํ๋ ค๋ ๋ค๋ฅธ ๊ฐ๋ฐ์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.