LuXDAmore/nuxt-prune-html

Change default string matching for lighthouse

gangsthub opened this issue ยท 4 comments

Hi!

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

  • Following this list of UAs, what if the default string was lighthouse|google page speed? Also, it was not directly clear that the lighthouseUserAgent was a (string that would compile to a) Regex value.

Describe the solution you'd like
A clear and concise description of what you want to happen.

  • Maybe we could add in the docs that lighthouseUserAgent will be converted to a Regex and that, by default, it is case insensitive.

Hi @gangsthub ๐Ÿ˜„

This plugin use the Javascript mobile-detect library, you can check HERE for the documentation about the match method..

lighthouseUserAgent is intended only for lighthouse (due to the fact that it's integrated in Chrome so you can check live for bugs or you can disable it on demand).

If you need to test a new 'userAgent', you can use the property matchUserAgent: 'String|Pattern' to handle it..


But yes, i think the documentation should be more clear about this feature:

[ String | RegExp ] the pattern, either as String or RegExp (a string will be converted to a case-insensitive RegExp).

Thank You ๐Ÿš€

BTW, thank you for the library, I'm planning to use it ๐Ÿ˜‰

Did you see the list of UAs that belong to lighthouse that I put in the original comment? That's why I suggested the change; only to target Lighthouse...

And yes, I saw it uses a 3rd party library, that's why I discovered that it is case insensitive by default.

@gangsthub I've seen the list (here too), but i think it's a little bit wrong (or outdated), Google is planning to use only Lighthouse (at the moment) to test websites performances, so they're adding the 'Lighthouse' User-Agent to every active system. (I did some research before publish the plugin, ex. here)

Ex. PageSpeed Insights, Measure and Lighthouse Audit in Chrome are already triggered by the plugin without the needing of change any value.


BTW, thank you for your help! ๐Ÿ˜„ If you have any doubt please don't hesitate to contact me ๐Ÿ˜Ž

@gangsthub I've seen the list (here too), but i think it's a little bit wrong (or outdated), Google is planning to use only Lighthouse (at the moment) to test websites performances, so they're adding the 'Lighthouse' User-Agent to every active system. (I did some research before publish the plugin, ex. here)

Ex. PageSpeed Insights, Measure and Lighthouse Audit in Chrome are already triggered by the plugin without the needing of change any value.

BTW, thank you for your help! ๐Ÿ˜„ If you have any doubt please don't hesitate to contact me ๐Ÿ˜Ž

Oh, that's insightful! Thank you very much for the info!! And for all your work!