Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
157 views
in Technique[技术] by (71.8m points)

Electron: How to enable SOP?

According to the official doc, "websecurity:true" is the default setting and enabling this setting means enable SOP.

However, in my app, the SOP seems like not working.

"electron": "^11.2.1"

macos:10.15.5

I downloaded the example "electron-quick-start".

I create the browserWindow :

mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
    }
  })

In my electron app, cross-domain request works and shows that doesn't violate SOP image

However, in chrome, cross-domain request doesn't works. image So, what did "websecurity:true" do? how can I use SOP to protect my app?

question from:https://stackoverflow.com/questions/65929946/electron-how-to-enable-sop

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...