Have you ever wanted to open an HTML file in Chrome, directly from the OSX terminal? Run source ~/.bash_profile from the terminal to reload it. Enjoy being able to type things like chrome index.html from the terminal.
Lighthouse is an, automated tool for improving the quality of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, and more.
You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module. You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve the page. Each audit has a reference doc explaining why the audit is important, as well as how to fix it. Check out the video below from Google I/O 2017 to learn more about how to use and contribute to Lighthouse.
Get started Choose the Lighthouse workflow that suits you best:. Easily audit pages that require authentication, and read your reports in a user-friendly format. Automate your Lighthouse runs via shell scripts. Integrate Lighthouse into your continuous integration systems.
Note: Every Lighthouse workflow requires you to have an instance of Google Chrome installed on your machine. Run Lighthouse in Chrome DevTools Lighthouse now powers the Audits panel of Chrome DevTools. To run a report:.
Download. In Google Chrome, go to the URL you want to audit. You can audit any URL on the web. Click the Audits tab. To the left is the viewport of the page that will be audited. To the right is the Audits panel of Chrome DevTools, which is now powered by Lighthouse.
Click Perform an audit. DevTools shows you a list of audit categories. Leave them all enabled. Click Run audit. After 60 to 90 seconds, Lighthouse gives you a report on the page.
A Lighthouse report in Chrome DevTools Install and run the Node command line tool To install the Node module:. Download.
Install the current version of. Install Lighthouse. The -g flag installs it as a global module. Npm install -g lighthouse To run an audit: lighthouse To see audit options: lighthouse -help Run the Node module programmatically See for an example of running Lighthouse programmatically, as a Node module. Run Lighthouse as a Chrome Extension Note: Unless you have a specific reason, you should use the Chrome DevTools workflow rather than this Chrome Extension workflow. The DevTools workflow provides the same benefits as the Extension workflow, with the added bonus of no installation needed. To install the extension:.
Download. Install the from the Chrome Webstore. To run an audit:. In Chrome, go to the page you want to audit. Click Lighthouse. It should be next to the Chrome address bar. If not, open Chrome's main menu and access it at the top of the menu.
After clicking, the Lighthouse menu expands. The Lighthouse menu. Click Generate report. Lighthouse runs its audits against the currently-focused page, then opens up a new tab with a report of the results. A Lighthouse report Share and view reports online Use the to view and share reports online.
The Lighthouse Viewer Share reports as JSON The Lighthouse Viewer needs the JSON output of a Lighthouse report. The list below explains how to get the JSON output, depending on what Lighthouse workflow you're using:.
Chrome DevTools. Click Download Report. Command line. Run: lighthouse -output json -output-path. Chrome Extension.
Click Export Save as JSON. To view the report data:.
Open the in Google Chrome. Drag the JSON file onto the viewer, or click anywhere on the Viewer to open your file navigator and select the file. Share reports as GitHub Gists If you don't want to manually pass around JSON files, you can also share your reports as secret GitHub Gists. One benefit of Gists is free version control. To export a report as a Gist from the Chrome Extension version of Lighthouse:.
Click Export Open In Viewer. The report opens in the Viewer, located at.
In the Viewer, click Share. The first time you do this, a popup asks permission to access your basic GitHub data, and to read and write to your Gists. To export a report as a Gist from the CLI version of Lighthouse, just manually create a Gist and copy-paste the report's JSON output into the Gist. The Gist filename containing the JSON output must end in.lighthouse.report.json. See for an example of how to generate JSON output from the command line tool. To view a report that's been saved as a Gist:.
Add?gist= to the Viewer's URL, where is the ID of the Gist. Open the, and paste the URL of a Gist into it. Contribute to Lighthouse Lighthouse is open source.
Check out the repository's to find bugs that you can fix, or audits that you can create or improve upon. The issues tracker is also a good place to discuss audit metrics, ideas for new audits, or anything else related to Lighthouse.
How Gatekeeper Works Whenever you launch a new application on your Mac, Gatekeeper checks to see that it’s signed with a valid signature. If the application is signed with a valid signature, it’s allowed to run.
If it’s not, you’ll see a warning message and your Mac will prevent the application from running. But not every Mac app is signed.
Some apps available on the web–particularly older ones–just aren’t signed, even if they’re trustworthy. Maybe they haven’t been updated in a while, or maybe the developer just didn’t bother. That’s why Apple offers a way to bypass Gatekeeper.
(You may also want to bypass this and run an unsigned app if you’re developing your own apps.) RELATED: Gatekeeper knows about three different types of apps:. Apps from the Mac App Store: from the Mac App Store are considered the most trustworthy, as they’ve gone through an Apple vetting process and are hosted by Apple themselves. They’re also sandboxed, although this is. Apps from Identified Developers: Mac app developers can acquire a unique developer ID from Apple and use it to sign their applications.
This digital signature ensures the application was actually created by that specific developer. For example, when you install Google Chrome on your Mac, it’s signed with Google’s developer ID so Apple allows it to run. If it’s discovered that a developer is abusing their developer ID–or it was acquired by hackers who are using it to sign malicious apps–the developer ID can then be revoked. In this way, Gatekeeper ensures only applications created by legitimate developers who have gone through the trouble of getting a developer ID and are in good standing can run on your computer. Apps from anywhere else: Apps that aren’t acquired from the Mac App Store and aren’t signed with a developer ID fall into this last category. Apple considers these the least secure, but it doesn’t mean an app is untrustworthy–after all, Mac apps that haven’t been updated in years may not be properly signed.
The default setting is to only allow apps from the first two categories: the Mac App Store and from identified developers. This setting should provide a good amount of security, allowing users to get apps from the app store or download signed apps from the web. How to Open an Unsigned App If you try opening an unsigned app by double-clicking it, it won’t work. You’ll see an “App Name can’t be opened because it is from an unidentified developer” message. Of course, there may be a time when you come upon an unsigned app that you need to use.
If you trust the developer, you can tell your Mac to open it anyway. Warning: Gatekeeper is a security feature, and it’s on by default for a reason. Only run apps you trust. To open an unsigned app, you need to right-click or Control-click the app and select “Open”. This works on macOS Sierra as well as previous versions of macOS. You’ll be warned that the app is from an unidentified developer–in other words, it isn’t signed with a valid developer signature. If you trust the app, click “Open” to run it.
Your Mac will remember this setting for each specific app you allow to run, and you won’t be asked again the next time you run that app. You’ll just have to do this the first time you want to run a new unsigned app. This is the best, most secure way to run a handful of unsigned apps. Just allow each specific app as you go, making sure you trust each app before you run it. How to Allow Apps From Anywhere In older versions of macOS, you could disable Gatekeeper entirely from System Preferences Security and Privacy. You’d just select “Anywhere” from the “Allow apps downloaded from” setting.
In macOS 10.12 Sierra, though, Apple changed this. You can no longer disable Gatekeeper entirely from the System Preferences window. That’s it–a single graphical option was removed. You can still choose to run individual unsigned apps, and there’s a hidden command line option to bypass Gatekeeper entirely. But Apple doesn’t want less knowledgeable users disabling this security feature, so it’s hidden that switch, just like. RELATED: If you know what you’re doing and need to change the setting, you can, though we don’t recommend it.
First, open a Terminal window. Press Command+Space, type “Terminal”, and press Enter to launch one. Or, you can open a Finder window and head to Applications Utilities Terminal. Run the following command in the Terminal window and provide your password: sudo spctl -master-disable After you do, head to System Preferences Security & Privacy. You’ll find that the old “Anywhere” option has returned and is enabled. Your Mac will now behave as it used to if you selected the “Anywhere” setting, and unsigned apps will run without any problem. To undo this change, just select “App Store and identified developers” or “App Store” in the Security & Privacy pane.
Apple is trying to make macOS more secure by hiding this option from less knowledgeable users. If you need to run unsigned applications, we encourage you to just allow them one by one rather than disabling Gatekeeper and allowing all unsigned applications to run. It’s almost as easy, and ensures nothing runs on your computer that you don’t approve yourself.