Skip to content

In mixed-content page page.exposeFunction is stuck indefinitely #2709

@yujiosaka

Description

@yujiosaka

Steps to reproduce

Tell us about your environment:

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Access to a mixed-content page.
  2. expose a function by page.exposeFunction.
  3. the execution is stuck indefinitely.
const puppeteer = require('puppeteer');
(async() => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  await page.goto('https://www.bennish.net/mixed-content.html');
  await page.exposeFunction('compute', function(a, b) {
    return Promise.resolve(a * b);
  });
  const result = await page.evaluate(async function() {
    return await compute(3, 5);
  });
  console.log(result);
  await browser.close();
})();

What is the expected result?

Expose function successfully or at lease throws an error.

What happens instead?

The execution is is stuck indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions