Giter VIP home page Giter VIP logo

electron-bug-example's Introduction

This projects illustrates a bug in Electron's WebView implementation. Specifically, the preload JavaScript which is injected before the first page load is lost upon any navigation.

Setup

npm i
node_modules/.bin/electron .

Electron will load a page that then loads http://www.google.com in a WebView which injects injected.js, and then opens devtools for that webview.

Expected Behavior

The string "THIS HAS BEEN INJECTED" should be output in the console upon every navigation event. When navigating anywhere, or executing window.location.reload() in the devtools console, the string should be presented.

Actual Behavior

The noted string will only be output on the initial load. If you type in "youtube" in google search, and then navigate to YouTube, there will be no output. You can also visit a website that presents a login form, which redirects you to itself when you fail to log-in. Or you can type window.location.reload() in the console.

In all cases, the output is expected.

Information:

  • electron-prebuilt 0.31.2
  • main.js is the standard main process script.
  • test.html loads index.js and contains the WebView
  • index.js opens the WebView's devtools on the 'dom-ready' event.
  • injected.js is the JavaScript we expect to be injected.

electron-bug-example's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.