Giter Site home page Giter Site logo

Comments (7)

msokk avatar msokk commented on May 30, 2024 1

Implemented a workaround, searching for some other string instead (chose unicode null character in order not to match anything). Pushed out v0.9 - you can try with that. Also the hang is fixed too.

from electron-render-service.

msokk avatar msokk commented on May 30, 2024

Hi,

Debugging your example - it does not work indeed.

(The render service actually just goes into a never-ending loop or so… it’s not possible to render another working URL, either.)

Semiobvious thing is missing - no response is returned after search times out (default is 30s) and the render window is not returned to pool.
Will push fix soon for this.

from electron-render-service.

msokk avatar msokk commented on May 30, 2024

Electron findInPage API returns zero results indefinitely for injected content.
Hmm, by trying it in Chrome 55 - immediately starting searching for foo, it also returns 0 results 😲.

Looks like this is a bug in Chrome since M53: https://crbug.com/670498
Constantly searching for the same string always returns 0 results.

from electron-render-service.

p3k avatar p3k commented on May 30, 2024

Yes, it works with the work-around – thanks a lot for the quick move! Very much appreciated.

from electron-render-service.

p3k avatar p3k commented on May 30, 2024

I think the fix for capturing the timeout to prevent the never-ending loop now causes an exception. If I set e.g. waitForText=foox and try to render the test file I get this:

delaying pdf generation, waiting for text "foox" to appear
Error: Failed to find text: foox
[2017-01-26T09:13:21.259Z] [email protected] - GET 404 /pdf?accessKey=secret&delay=0&url=http://10.5.0.141:2015&waitForText=foox 73 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.2883.87 Chrome/55.0.2883.87 Safari/537.36" 22729.453 ms
/usr/lib/node_modules/electron-render-service/src/server.js:253
process.on('uncaughtException', (err) => { throw err; });
                                           ^

Error: Callback was already called.
    at /usr/lib/node_modules/electron-render-service/node_modules/async/internal/onlyOnce.js:9:32
    at renderWorker (/usr/lib/node_modules/electron-render-service/src/window_pool.js:85:7)
    at WebContents.foundInPage (/usr/lib/node_modules/electron-render-service/src/renderer.js:100:28)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)

Result in the browser window seems to be OK:

{"error":{"code":"TEXT_NOT_FOUND","message":"Failed to find text: foox"}}

from electron-render-service.

msokk avatar msokk commented on May 30, 2024

Oops, forgot to remove the found-in-page event listener in not found case. Pushed 0.9.1

from electron-render-service.

p3k avatar p3k commented on May 30, 2024

Great, working perfectly now. Thanks again.

from electron-render-service.

Related Issues (20)

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.