Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do we use it programmatically? #380

Open
dqureshiumar opened this issue Dec 28, 2022 · 1 comment
Open

How do we use it programmatically? #380

dqureshiumar opened this issue Dec 28, 2022 · 1 comment

Comments

@dqureshiumar
Copy link

I wanted to integrate this Plugin in the Lighthouse Library. No proper documentation is provided to do so

@JWebDev
Copy link

JWebDev commented May 28, 2023

@connorjclark @jimper @jburger424 - Hi all. I have the same question and will grateful for the help.
My lighthouse config looks like.
After that, i should see lighthouse-plugin-publisher-ads in categories object. If i run lighthouse from command line, then generated json has lighthouse-plugin-publisher-ads in categories section. If i run it programatically, then lighthouse-plugin-publisher-ads does not exists in generated json report in categories object

runnerResult = await lighthouse(url, flags, configs, page)
configs object

{
   "extends": "lighthouse:default",
   "settings": {
      "formFactor": "desktop",
      "disableFullPageScreenshot": false,
      "locale": "en",
      "screenEmulation": {
         "disabled": true
      },
      "onlyCategories": [
         "performance",
         "accessibility",
         "best-practices",
         "seo",
         "pwa"
      ]
   },
   "plugins": [
      "lighthouse-plugin-publisher-ads"
   ]
}

lighthouse-plugin-publisher-ads is in package.json

  "dependencies": {
    "lighthouse": "^10.2.0",
    "lighthouse-plugin-publisher-ads": "1.5.7-beta",
    "puppeteer": "^19.9.1"
  },
  "overrides": {
    "lighthouse-plugin-publisher-ads": {
      "lighthouse": "$lighthouse"
    }
  }

thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants