examples
examples copied to clipboard
Make google_search_features.js work on pages without CSS
When no CSS features are used at the specified URL, it exits with an error:
(node:11369) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'reduce' of undefined
at uniqueByProperty (google_search_features.js:99:34)
at google_search_features.js:244:22
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
The content of the failing page was as follows:
Hi
<script type="text/javascript">
console.log(['a', 'b'].includes('b') ? 'has b' : 'no b');
</script>
This pull request provides a default argument to one of the utility functions to prevent said reduce errors.
Good catch!
Ping.