⤵
- Install https://pngquant.org/
$ brew install pngquant
⤵
$ brew install pngquant
GitHub uses the following CSS font stack to display code:
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;
Chrome will use SFMono-Regular
when that font is installed locally, but Firefox will not. Workaround: Add the following CSS to your Firefox profile's userContent.css
file:
@font-face {
# To run: | |
# osascript firefox-open-tab.applescript http://technosophos.com | |
# | |
# References: | |
# https://support.mozilla.org/en-US/questions/1130718 | |
# https://stackoverflow.com/questions/3645763/how-do-i-instruct-applescript-to-open-a-new-firefox-window-with-a-link | |
on firefoxRunning() | |
tell application "System Events" to (name of processes) contains "firefox" | |
end firefoxRunning |
-- AppleScript -- | |
-- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
-- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
-- This method is as good as its JXA counterpart. | |
-- Google Chrome | |
tell application "Google Chrome" to return title of active tab of front window | |
tell application "Google Chrome" to return URL of active tab of front window | |
-- Google Chrome Canary |
<!-- | |
Copyright 2016 Google Inc. All rights reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and |
NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y
Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.
As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)
To enable the accessibility inspector in Chrome stable:
Revised: 2019-11-28 16:16 GMT-6
This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.
I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.
// How to use: | |
// 1. Open "Script Editor" (requires OS X 10.10 Yosemite) | |
// 2. Change the language from "AppleScript" to "JavaScript" | |
// 3. Paste the code below and replace the safari example. | |
// | |
// More info: | |
// https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html | |
var sys_events = Application("System Events"); |
def get_job_message | |
$job_message ? "\n " + $job_message : '' | |
end | |
def create_matcher_for(match_symbol, expected_str = nil, not_expected_str = nil, &block) | |
RSpec::Matchers.define match_symbol do |expected| | |
match do |actual| | |
case match_symbol | |
when :be_true | |
!!actual |
#=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
#=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click_on('Button Value') |