Skip to content

How to catch alert is open to close it or disable alert function on iframe? #10569

Closed

Description

@phanthai12

Im using:
Electron: v1.8.0
OS: Windows 10 Pro

My Code:

const {app, BrowserWindow} = require('electron')
function createWindow(){
    mainWindow =  new BrowserWindow({
        width: 800, 
        height: 600
    });
    mainWindow.loadURL("https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert");
}
app.on('ready', ()=>{
    createWindow();
})
// Quit when all windows are closed.
app.on('window-all-closed', () => {
  // On macOS it is common for applications and their menu bar
  // to stay active until the user quits explicitly with Cmd + Q
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

And the result when i click "Try it":
My capture

And how to catch alert is open to close it or another way to disable alert function in iframe?

Activity

  1. codebytere commented on Sep 22, 2017

    @codebytere
    Member

    Hey there, this doesn't appear to be an issue so much as a question about how to implement your desired functionality; have you tried asking this question in the slack rooms or other electron forums?

  2. phanthai12 commented on Sep 24, 2017

    @phanthai12
    Author

    It is an issue.
    I try to using preload to disable function alert in mainFrame, it worked
    And when i try a page with iframe have alert function, the preload not worked.

    So, is this a issue?

  3. codebytere commented on Sep 24, 2017

    @codebytere
    Member

    Ah, i misunderstood your question. Yes, and i'll try to take a look soon!

  4. sofianguy commented on Jan 7, 2019

    @sofianguy
    Contributor

    Thank you for taking the time to report this issue and helping to make Electron better.

    The version of Electron you reported this on has been superseded by newer releases.

    If you're still experiencing this issue in Electron v2.0.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.

    I'm setting the blocked/need-info label for the above reasons.

    Thanks in advance! Your help is appreciated.

  5. added
    blocked/need-info ❌
    on Jan 7, 2019
  6. sofianguy commented on Jan 15, 2019

    @sofianguy
    Contributor

    Thank you for your issue!

    We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.

  7. added 5 commits that reference this issue on Jan 17, 2019
    f5a166d
    aadee6c
    58a6fe1
    f883aa0
    0890b0c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked/need-info ❌bug 🪲platform/windowsversion/1.8.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions