question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedding in another extension

See original GitHub issue

Feature request summary

Hey, I think it could be really nice if there was a way to embed lighthouse in another extension.

We’re developing an extension that already utilizes the devtools protocol and opens chrome.debugger.

Currently I was thinking about embedding an audit through the programmatic interface and CLI tool but it would be much nicer if there was a way to (from a Chrome extension context) pass a connected chrome.debugger tabId (or something similar) and embed lighthouse into another extension.

What is the motivation or use case for changing this?

Improving the UI/UX of the extension and being able to use lighthouse directly instead of reusing parts of it or giving users a subpar solution requiring a cli tool.

How is this beneficial to Lighthouse?

Bigger/better ecosystem and motivation for more extensions to get into the “care about site performance” field.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brendankennycommented, Mar 25, 2019

The main thing we would want to do is automate maintenance (and not breaking users) as much as possible, so some good tests of the bundled output would be necessary.

maybe we could even always do standalone: 'lighthouse' and move the lighthouse (core) extension to using it. Then the existing test pipeline would make sure things are still working.

We’d have to see if that would be a net improvement in code readability or if it would just make things more complicated than it’s worth, though.

1reaction
brendankennycommented, Mar 25, 2019

It’d really be great not having to keep a fork of the code for this and using lighthouse as an npm module for browser extension development.

Rather than publishing another npm module (with the maintenance and ownership overhead that brings), I think maybe the effort could be put into making the use of lighthouse as an npm module in this way easier.

A Connection is able to be passed into the lighthouse module specifically for allowing use cases like this without requiring users to fork lighthouse. Maybe we could do whatever work is needed to better clean and document the Driver <-> Connection interface so this is easier and more obvious to do. That would improve the core of lighthouse and allow easier downstream usage.

Then it sounds like adding a --standalone (or whatever) flag to ./build/build-bundle.js would let you consume it in the browser (extension) space without maintaining your parallel browserify pipeline. The main thing we would want to do is automate maintenance (and not breaking users) as much as possible, so some good tests of the bundled output would be necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When can we embed field extensions into one another?
Consider the following two-sorted first order theory. We have one sort for L and one sort for M, and we have constant symbols...
Read more >
Extending and Embedding - Esoteric Curio
I've embedded Python once, perl and Java countless times and, ... as much as I need a convenient extension out of C. In...
Read more >
Extending and Embedding the Python Interpreter — Python ...
This document describes how to write modules in C or C++ to extend the Python interpreter with new modules. Those modules can not...
Read more >
From object to iframe — other embedding technologies
<iframe> s are for embedding other web pages, and the other two allow you to embed external resources such as PDF files.
Read more >
Embedding vs. Extending - the Tcler's Wiki!
In extending, you have an existing Tcl interpreter and dynamically load extra packages (whether defined in Tcl, as a loadable library, or as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found