Open rogerxu opened 7 years ago
Beyond Console Debugging Tricks – OutSystems Experts – Medium
Things you probably didn’t know you could do with Chrome’s Developer Console
Like debugger;
console.trace();
console.table(array);
console.table(array);
console.profile();
console.dir(obj);
debug(myFunc);
monitor(myFunc);
monitorEvents($('selector'));
monitorEvents($('selector'), 'eventName');
monitorEvents($('selector'), ['eventName1', 'eventName2']);
unmonitorEvents($('selector'));
Equivalent to the jQuery selector syntax. It returns the first element in the DOM that matches the selector.
$('tagName')
$('.class')
$('#id')
Use $$
to select all the elements.
$$('tagName')
$$('.class')
Use $x
to select by XPath
$x("//tagName'")
$x("//div[@id='id']")
$x("//div[contains(@class, 'class')]")
document.body.contentEditable = true
For entire page
document.designMode = 'on';
getEventListeners($('#firstName')).click[0].listener
$_
chrome://flags
(350) 11 Chrome Settings You Should Change Now! - YouTube
#show-saved-copy
#enable-parallel-downloading
#new-omnibox-answer-types
#omnibox-ui-show-suggestion-favicons
#automatic-tab-discarding
#enable-tab-audio-muting
#enable-fast-unload
#enable-scroll-anchoring
New in Chrome 62 | Web | Google Developers What's New In DevTools (Chrome 62) | Web | Google Developers
navigator.connection.effectiveType
> 3g
.heading {
font-family: "Avenir Next Variable";
font-size: 48px;
font-variation-settings: 'wght' 700, 'wdth' 75;
}
.content {
font-family: "Avenir Next Variable";
font-size: 24px;
font-variation-settings: 'wght' 400;
}
await
in the ConsoleCtrl
and select the region of the viewport.-<text>
to filter out any message that includes <text>
.
url:<text>
New in Chrome 63 | Web | Google Developers What's New In DevTools (Chrome 63) | Web | Google Developers
button.addEventListener('click', event => {
import('./dialogBox.js')
.then(dialogBox => {
dialogBox.open();
})
.catch(error => {
/* Error handling */
});
});
async function* getChunkSizes(url) {
const response = await fetch(url);
const b = response.body;
for await (const chunk of magic(b)) {
yield chunk.length;
}
}
.messages {
overscroll-behavior: contain;
}
Promise.prototype.finally
Promise.prototype.finally | Web | Google Developers
const fetchAndDisplay = ({ url, element }) => {
showLoadingSpinner();
fetch(url)
.then((response) => response.text())
.then((text) => {
element.textContent = text;
})
.catch((error) => {
element.textContent = error.message;
})
.finally(() => {
hideLoadingSpinner();
});
};
Using async/await
const fetchAndDisplay = async ({ url, element }) => {
showLoadingSpinner();
try {
const response = await fetch(url);
const text = await response.text();
element.textContent = text;
} catch (error) {
element.textContent = error.message;
} finally {
hideLoadingSpinner();
}
};
const pr = new Intl.PluralRules('en-US');
pr.select(0); // 0 puppies
pr.select(1); // 0 puppy
pr.select(2); // 2 puppies
New in Chrome 64 | Web | Google Developers
What's New In DevTools (Chrome 64) | Web | Google Developers
ResizeObserver
It is like document.onresize
for elements.
Block pop-up which navigates the page.
import.meta
It exposes the URL for the module as import.meta.url
.
window.alert()
No longer brings a background tab to the foreground.
New in Chrome 65 | Web | Google Developers What's New In DevTools (Chrome 65) | Web | Google Developers
The CSS Paint API allows you to grammatically generate an image for CSS properties like background-image
or border-image
.
The new Server Timing API allows your server to pass timing information to the browser; giving you a better picture of your overall performance by adding a Server-Timing
header to your response:
'Server-Timing': 'su=42;"Start-up",db-read=142;"Database Read"'
display: contents
Adding display: contents
to the outer div, makes the outer div disappear and its constraints are no longer applied to the inner div. The inner div is now 100% width.
Override network requests and serve local resources on your filesystem instead.
Track changes that you make locally in DevTools via the new Changes tab.
Use the Accessibility pane on the Elements panel to investigate the accessibility properties of the currently-selected element.
New in Chrome 66 | Web | Google Developers
What's New In DevTools (Chrome 66) | Web | Google Developers
el.attributeStyleMap.set('opacity', 0.3);
const oType = el.attributeStyleMap.get('opacity').value; // 0.3
It also helps to eliminate bugs caused by forgetting to cast the value from a string to a number, and it automatically handles rounding and clamping of values.
el.style.opacity = 3;
const opacity = el.computedStyleMap().get('opacity').value;
console.log(opacity);
> 1
navigator.clipboard.writeText('Copy me!')
.then(() => {
console.log('Text is on the clipboard.');
});
navigator.clipboard.getText()
.then((text) => {
console.log('Clipboard: ', text);
});
BitmapRenderer
const image = await createImageBitmap(imageBlob);
const context = el.getContext('bitmaprenderer');
context.transferFromImageBitmap(image);
autocomplete
attribute in TextArea
and Select
autocapitalize
attribute on for
trimStart()
and trimEnd()
for stringsThe Initiator column in the Network panel tells you why a resource was requested. After blackboxing a script, it hides any calls from the script that you blackboxed.
The Preview tab in the Network panel now pretty-prints resources by default when it detects that those resources have been minified.
New in Chrome 67 | Web | Google Developers
const sensor = new Gyroscope({frequency: 500});
sensor.start();
sensor.onreading = () => {
console.log("X-axis " + sensor.x);
console.log("Y-axis " + sensor.y);
console.log("Z-axis " + sensor.z);
};
BigInt
let max = BigInt(Number.MAX_SAFE_INTEGER);
// → 9_007_199_254_740_991n
max = max + 9n;
// → 9_007_199_254_741_000n - Yay!
What's New In DevTools (Chrome 67) | Web | Google Developers
Select Copy > Copy As Fetch to copy the fetch()
-equivalent code.
New in Chrome 68 | Web | Google Developers
What's New In DevTools (Chrome 68) | Web | Google Developers
New in Chrome 69 | Web | Google Developers
#gallery {
scroll-snap-type: x mandatory;
overflow-x: scroll;
display: flex;
}
#gallery img {
scroll-snap-align: center;
}
<meta name='viewport' content='initial-scale=1, viewport-fit=cover'>
navigator.locks.request('network_sync_lock', async lock => {
// The lock has been acquired.
await do_something();
await do_something_else();
// Now the lock will be released.
});
New in Chrome 70 | Web | Google Developers
workers
In Chrome 70, workers now have a name
attribute, which is specified by an optional argument on the constructor.
const url = '/scripts/my-worker.js';
const wNYC = new Worker(url, {name: 'NewYork'});
const oSF = {name: 'SanFrancisco'};
const wSF = new Worker(url, oSF);
What's New In DevTools (Chrome 70) | Web | Google Developers
New in Chrome 71 | Web | Google Developers
Intl.RelativeTimeFormat()
const rtf = new Intl.RelativeTimeFormat('en');
rtf.format(3.14, 'second');
// → 'in 3.14 seconds'
rtf.format(-15, 'minute');
// → '15 minutes ago'
.left {
text-underline-position: left;
}
.right {
text-underline-position: right;
}
What's New In DevTools (Chrome 71) | Web | Google Developers
New in Chrome 72 | Web | Google Developers
class Counter {
_value = 0;
get value() {
return this._value;
}
increment() {
this._value++;
}
}
const counter = new Counter();
console.log(counter.value);
// → 0
counter.increment();
console.log(counter.value);
// → 1
Intl.format
const lf = new Intl.ListFormat('en');
lf.format(['Frank']);
// → 'Frank'
lf.format(['Frank', 'Christine']);
// → 'Frank and Christine'
lf.format(['Frank', 'Christine', 'Flora']);
// → 'Frank, Christine, and Flora'
lf.format(['Frank', 'Christine', 'Flora', 'Harrison']);
// → 'Frank, Christine, Flora, and Harrison'
const lf = new Intl.ListFormat('en', { type: 'disjunction' });
lf.format(['Frank']);
// → 'Frank'
lf.format(['Frank', 'Christine']);
// → 'Frank or Christine'
lf.format(['Frank', 'Christine', 'Flora']);
// → 'Frank, Christine, or Flora'
lf.format(['Frank', 'Christine', 'Flora', 'Harrison']);
// → 'Frank, Christine, Flora, or Harrison'
What's New In DevTools (Chrome 72) | Web | Google Developers
including a new audit that detects JS libraries and new keywords for accessing the Audits panel from the Command Menu.
New in Chrome 73 | Web | Google Developers
Signed HTTP Exchanges (SGX), part of an emerging technology called Web Packages is now available in Chrome 73. A Signed HTTP Exchange makes it possible to create “portable” content that can be delivered by other parties, and this is the key aspect, it retains the integrity and attribution of the original site.
Constructable Stylesheets make it possible to define and prepare shared CSS styles, and then apply those styles to multiple Shadow Roots or the Document easily and without duplication.
What's New In DevTools (Chrome 73) | Web | Google Developers
Use Logpoints to log messages to the Console without cluttering up your code with console.log()
calls.
When inspecting a node, DevTools now shows an expanded tooltip containing commonly important information like font size, font color, contrast ratio, and box model dimensions.
Pressing Shift+Tab
focuses the last message (or result of an evaluated expression). If the message contains links, the last link is highlighted first. Pressing Enter
opens the link in a new tab. Pressing the Left
arrow key highlights the entire message.
Pressing the Right
arrow key expands a collapsed stack trace (or object, array, and so on).
The Sensors tab now lets you save custom geolocation overrides.
The Sources and Network panels now support code folding.
Settings > Preferences > Sources enable Code folding.
New in Chrome 74 | Web | Google Developers
class IncreasingCounter {
// Private class field
#privateValue = 0;
get value() {
return this.#privateValue;
}
increment() {
this.#privateValue++;
}
}
prefers-reduced-motion
@media (prefers-reduced-motion: reduce)
transition
eventstransitionrun
transitionstart
transitionend
transitioncancel
What's New In DevTools (Chrome 74) | Web | Google Developers
Hover over a CSS property that affects a node's box model, such as padding
or margin
, to highlight all nodes affected by that declaration.
Command Menu > Capture area screenshots. Drag your mouse over the section of the viewport that you want to screenshot.
Type is:service-worker-initiated
or is:service-worker-intercepted
in the Network panel filter text box to view requests that were caused (initiated
) or potentially modified (intercepted
) by a service worker.
The Timings section of a Performance recording now marks First Paint.
New in Chrome 75 | Web | Google Developers
canvas
contextsAdd desynchronized: true
to the options object when creating the canvas.
Use navigator.canShare
to check if file sharing is supported.
Numeric literals now allow underscores (_
, U+005F) as separators to make them more readable. For example, 1_000_000_000
will be interpreted by mathematical operations as equivalent to 1000000000
.
What's New In DevTools (Chrome 75) | Web | Google Developers
The new autocomplete behavior. DevTools is autocompleting to filter: blur(1px)
and the change is visible in the viewport.
Hovering over the Size column to view a resource's uncompressed size.
You can now disable these detailed tooltips from Settings > Preferences > Elements > Show Detailed Inspect Tooltip.
To override the default behavior and use Tab to move focus, enable Settings > Preferences > Sources > Enable Tab Moves Focus.
New in Chrome 76 | Web | Google Developers
If your site meets the Progressive Web App installability criteria, Chrome will show an install button in the omnibox indicating to the user that your PWA can be installed. If the user clicks the install button, it’s essentially the same as calling prompt()
on the beforeinstallprompt
event; it shows the install dialog, making it easy for the user to install your PWA.
On mobile, Chrome shows the mini-infobar the first time a user visits your site if it meets the Progressive Web App installability criteria.
Starting in Chrome 76, calling preventDefault()
on the beforeinstallprompt
event will stop the mini-infobar from appearing.
When a Progressive Web App is installed on Android, Chrome automatically requests and installs a Web APK. After it’s been installed, Chrome periodically checks if the web app manifest has changed.
Starting in Chrome 76, Chrome will check the manifest more frequently; checking every day, instead of every three days.
The prefers-color-scheme
media query, allows you to adjust the look and feel of your site to match the user's preferred mode.
Promise.allSettled()
Promise.allSettled()
is similar to Promise.all()
, except it waits until all of the promises are settled before returning.
Blobs are easier to read with three new methods: text()
, arrayBuffer()
, and stream()
; this means we don’t have to create a wrapper around file reader any more!
Support for images to the Asynchronous Clipboard API, making it easy to programmatically copy and paste images.
Image Support for the Async Clipboard API | Web | Google Developers
What's New In DevTools (Chrome 76) | Web | Google Developers
The Style pane's autocomplete UI now supports CSS values.
The _webSocketMessages
property begins with an underscore to indicate that it's a custom field.
...
"_webSocketMessages": [
{
"type": "send",
"time": 1558730482.5071473,
"opcode": 1,
"data": "Hello, WebSockets!"
},
{
"type": "receive",
"time": 1558730482.5883863,
"opcode": 1,
"data": "Hello, WebSockets!"
}
]
...
Use the new Background Services section of the Application panel to monitor Background Fetch and Background Sync events.
New in Chrome 77 | Web | Google Developers
The Largest Contentful Paint API, available starting in Chrome 77, reports the render time of the largest content element visible in the viewport and makes it possible to measure when the main content of the page is loaded.
formdata
eventThe formdata
event is a low-level API that lets any JavaScript code participate in a form submission.
const form = document.querySelector('form');
form.addEventListener('formdata', ({formData}) => {
formData.append('my-input', myInputValue);
});
Form-associated custom elements help to bridge the gap between custom elements and native controls. Adding a static formAssociated
property tells the browser to treat the custom element like all other form elements.
To tell the browser you want an image, or iframe lazy loaded, use the loading=”lazy”
attribute. Images and iframes that are “above the fold” load normally. And those that are below, are only fetched when the user scrolls near them.
<img src="image.jpg" loading="lazy" width="400" height="250" alt="...">
What's New In DevTools (Chrome 77) | Web | Google Developers
DevTools can now help you detect layout shifting:
Rendering
.The Size column of the Network panel now says (prefetch cache
) when a resource was loaded from the prefetch cache.
The Console now shows private class fields in its object previews.
The Background Services section of the Application panel now supports Push Messages and Notifications.
New in Chrome 78 | Web | Google Developers
html {
--my-color: url(‘not-a-color’); // Oops, not a color!
}
.thing {
color: var(--my-color);
}
Registering a property is as easy as calling window.CSS.registerProperty()
and providing the name of the property you’re defining the type of property it is, if it should inherit, and it’s initial value.
window.CSS.registerProperty({
name: '--my-color',
syntax: '<color>',
inherits: false,
initialValue: 'black',
});
Byte-for-byte checks are now performed for service worker scripts imported by importScripts()
.
Origin trials provide an opportunity for us to validate experimental features and APIs, and make it possible for you to provide feedback on their usability and effectiveness in broader deployment.
Opting into an origin trial allows you to build demos and prototypes that your beta testing users can try for the duration of the trial without requiring them to flip any special flags in Chrome.
What's New In DevTools (Chrome 78) | Web | Google Developers
You can now use the Audits panel in combination with other DevTools features like Request Blocking and Local Overrides.
The Background Services section of the Application panel now supports Payment Handler events.
New in Chrome 79 | Web | Google Developers
Installed Progressive Web Apps on Android now support maskable icons.
You can now create immersive experiences with the WebXR Device API.
To request a wake lock, you need to call navigator.wakeLock.request()
, and save the WakeLockSentinel
object that it returns.
rendersubtree
attributeThere are times when you don’t want part of the DOM to render immediately. For example scrollers with a large amount of content, or tabbed UIs where only some of the content is visible at any given time.
The new rendersubtree
attribute tells the browser it can skip rendering that subtree. This allows the browser to spend more time processing the rest of the page, increasing performance.
What's New In DevTools (Chrome 79) | Web | Google Developers
After recording network activity, select a network resource and then navigate to the updated Cookies tab to understand why that resource's request or response cookies were blocked.
prefers-color-scheme
and prefers-reduced-motion
preferencesThe prefers-color-scheme
media query lets you match your site's style to your user's preferences.
The Sensors tab now lets you not only override geolocation, but also emulate arbitrary timezones and test the impact on your web apps. Perhaps surprisingly, this new feature improves the reliability of geolocation emulation as well: previously, web apps could detect location spoofing by matching the location against the user's local timezone. Now that geolocation and timezone emulation are coupled, this category of mismatches is eliminated.
The Coverage tab now uses new colors to represent used and unused code.
After recording network activity, select a network resource and then navigate to the Initiator tab to understand why the resource was requested. The Request call stack section describes the JavaScript call stack leading up to the network request.
Go to Settings > Preferences > Sources > Default Indentation to set your preference.
Press Ctrl+P in the Console or Sources panels to move your cursor to the line above. Press Ctrl+N to move your cursor to the line below.
New in Chrome 80 | Web | Google Developers
The Worker constructor accepts a new {type: "module"}
option, which changes the way scripts are loaded and executed, to match <script type="module">
// Still checks for errors and is much more readable.
const nameLength = db?.user?.name?.length;
It periodically synchronizes data in the background, so that when a user opens your installed PWA, they always have the freshest data.
It's an on-demand API that allows users to select entries from their contact list and share limited details of the selected entries with a website.
The Get Installed Related Apps method allows your web app to check if your native app is installed on a user's device.
The Content Indexing API, is a new origin trial, that allows you to add URLs and metadata of offline-capable content, to a local index, maintained by the browser, and easily visible to the user.
Notification Triggers let you schedule notifications in advance, so that the operating system will deliver the notification at the right time - even if there is no network connectivity, or the device is in battery saver mode.
You can now link directly to text fragments on a page, by using #:~:text=something
. Chrome will scroll to and highlight the first instance of that text fragment. For example
https://en.wikipedia.org/wiki/Rickrolling#:~:text=New%20York
display: minimal-ui
Setting display: minimal-ui
on a Desktop PWA adds a back and reload button to the title bar of the installed PWA.
Chrome now supports using SVG images as favicons.
What's New In DevTools (Chrome 80) | Web | Google Developers
let
and class
redeclarations in the ConsoleDevTools has started to support the DWARF Debugging Standard, which means increased support for stepping over code, setting breakpoints, and resolving stack traces in your source languages within DevTools.
DevTools supports setting a custom User-Agent string through the Network Conditions tab.
New in Chrome 81 | Web | Google Developers
Badging of app icons makes it easy to subtly notify the user that there is some new activity that might require their attention, or to indicate a small amount of information, such as an unread count.
What's New In DevTools (Chrome 81) | Web | Google Developers
The Cookies pane in the Application panel now colors blocked cookies with a yellow background.
Hover over the value of a content
property to see the unescaped version of the value.
New in Chrome 83 | Web | Google Developers
Trusted types help prevent cross site scripting vulnerabilities.
With trusted types turned on, if I try to pass a string, it'll fail with a TypeError because the browser doesn’t know if it can trust the string.
// Trusted types turned on
const elem = document.getElementById('myDiv');
elem.innerHTML = `Hello, world!`;
// Will throw a TypeError
Instead, I need to either use a safe function, like textContent
, pass in a trusted type, or create the element and use appendChild()
.
// Use a safe function
elem.textContent = ''; // OK
// Pass in a trusted type
import DOMPurify from 'dompurify';
const str = `Hello, world!`;
elem.innerHTML = DOMPurify.sanitize(str, {RETURN_TRUSTED_TYPE: true});
// Create an element
const img = document.createElement('img');
img.src = 'xyz.jpg';
elem.appendChild(img);
measureMemory()
performance.measureMemory()
is a new API that makes it possible to measure the memory usage of your page, and detect memory leaks.
async function writeURLToFile(fileHandle, url) {
// Create a FileSystemWritableFileStream to write to.
const writable = await fileHandle.createWritable();
// Make an HTTP request for the contents.
const response = await fetch(url);
// Stream the response into the file.
await response.body.pipeTo(writable);
// pipeTo() closes the destination pipe automatically.
}
Writable streams make it much easier to write to a file, and because it’s a stream, you can easily pipe responses from one stream to another.
Some web APIs increase the risk of side-channel attacks like Spectre. To mitigate that risk, browsers offer an opt-in-based isolated environment called cross-origin isolated.
What's New In DevTools (Chrome 83) | Web | Google Developers
Open the Rendering tab and use the new Emulate vision deficiencies feature to get a better idea of how people with different types of vision deficiencies experience your site.
You can now emulate locales by setting a location in Sensors > Location.
The Network panel now provides Cross-Origin Embedder Policy debugging information.
The Status column now provides a quick explanation of why a request was blocked as well as a link to view that request's headers for further debugging:
The Response Headers section of the Headers tab provides more guidance on how to resolve the issues:
The Sources panel has new icons for breakpoints, conditional breakpoints, and logpoints:
Use the new cookie-path
filter keyword in the Network panel to focus on the network requests that set a specific cookie path.
Chrome 84 arrives with SameSite cookie changes, Web OTP API and Web Animations API | VentureBeat
New in Chrome 84 | Web | Google Developers
App icon shortcuts make it easy for users to quick start common tasks within your app.
animation.ready
and animation.finished
have been promisified.add
and accumulate
options.If your content is available without a network connection. With the Content Indexing API, you can add URLs and metadata for content that’s available offline.
To add content to the index, call index.add()
on the service worker registration, and provide the required metadata about the content.
To get a wake lock, call navigator.wakeLock.request()
, it returns a WakeLockSentinel
object, used to “release” the wake lock.
Web Assembly SIMD introduces operations that map to commonly available SIMD instructions in hardware. SIMD operations are used to improve performance, especially in multimedia applications.
What's New In DevTools (Chrome 84) | Web | Google Developers
The new Issues tab in the Drawer aims to help reduce the notification fatigue and clutter of the Console.
The Inspect Mode tooltip now indicates whether the element has an accessible name and role and is keyboard-focusable.
TBT is a load performance metric that helps quantify how long it takes a page to become usable.
The new Experience section of the Performance panel can help you detect layout shifts.
The Console now uses the term fulfilled, which aligns with the Promise
spec:
revert
keywordThe Styles pane's autocomplete UI now detects the revert
CSS keyword, which reverts the cascaded value of a property to what the value would have been if no changes had been made to the element's styling.
Hover over a background-image
value in the Styles pane to see a preview of the image in a tooltip.
CSS Color Module Level 4 specifies that color functions like rgb()
should support space-separated arguments. For example, rgb(0, 0, 0)
is equivalent to rgb(0 0 0)
.
The Properties pane in the Elements panel has been deprecated. Run console.dir($0)
in the Console instead.
Chrome 85 arrives with tab management, 10% faster page loads, and PDF improvements | VentureBeat
New in Chrome 85 | Web | Google Developers
Applying content-visibility: auto
to an element, tells the browser that it can skip the rendering work for that element until it scrolls into the viewport, providing a faster initial render.
.my-class {
content-visibility: auto;
}
@property
and CSS variablesStarting in Chrome 85, you can also define and set CSS properties directly in your CSS.
@property --colorPrimary {
syntax: '<color>';
initial-value: magenta;
inherits: false;
}
The getInstalledRelatedApps()
API makes it possible for you to check if your app is installed, then, customize the user experience.
Now, on Android, it can also check if your PWA is installed. And on Windows, it can check if your Windows UWP app is installed.
fetch()
Promise.any()
Promise.any
returns a promise that is fulfilled by the first given promise to be fulfilled or rejected.
String.prototype.replaceAll()
Replacing all instances in a string is easier with .replaceAll()
, no more regular expressions!
Chrome 85 adds decode support for AVIF, an image format encoded with AV1 and standardized by the Alliance for Open Media. AVIF offers significant compression gains vs. JPEG and WebP, with a recent Netflix study showing 50% savings vs. standard JPEG and > 60% savings on 4:4:4 content.
What's New In DevTools (Chrome 85) | Web | Google Developers
The Styles pane now has better support for editing styles that were created with the CSS Object Model (CSSOM) APIs.
Lighthouse 6.0 introduces three new metrics to the report: Largest Contentful Paint (LCP), Cumulative Layout Shift (CLS), and Total Blocking Time (TBT).
First Meaningful Paint (FMP) is deprecated in Lighthouse 6.0. It has also been removed from the Performance panel. Largest Contentful Paint is the recommended replacement for FMP.
> name?.
Private class fields are now properly syntax-highlighted and pretty-printed in the Sources panel.
DevTools now properly pretty-prints the nullish coalescing operator in the Sources panel.
When performing copy or cut with no selection in the Sources panel editor, DevTools will copy or cut the current line content.
Chrome 86 brings password protections for Android and iOS, VP9 for macOS Big Sur | VentureBeat
New in Chrome 86 | Web | Google Developers
Today, you can use the <input type="file">
element read a file from disk. You can call showOpenFilePicker()
, which shows a file picker, then returns a file handle that you can use to read the file.
To save a file to disk, you can either use that file handle that you got earlier, or call showSaveFilePicker()
to get a new file handle.
Calling showDirectoryPicker()
will open a directory, allowing you to get a list of files, or create new files in that directory.
Human interface devices, commonly referred to as HID, takes input from, or provides output to... humans.
The Multi-Screen Window Placement API, starts an origin trial in Chrome 86, it allows you to enumerate the screens connected to your machine, and place windows on specific screens. Being able to place windows on specific screens is critical for things like presentation apps, financial services apps, and more.
Once the user has granted permission, calling window.getScreens()
returns a promise that resolves with an array of Screen objects.
:focus-visible
The new CSS selector, :focus-visible
, lets you opt-in to the same heuristic the browser uses when it's deciding whether to display the default focus indicator.
What's New In DevTools (Chrome 86) | Web | Google Developers
You can take a screenshot of the table of content by right clicking the element and select Capture node screenshot.
Open the Rendering tab and use the new Disable local fonts feature to emulate missing local()
sources in @font-face
rules.
You can now use DevTools to emulate idle state changes in the Sensors tab for both the user state and the screen state.
&&=
, ||=
, and ??=
in the Console and Sources panels.DevTools now show a detailed view for each frame. Access it by clicking a frame under the Frames menu in the Application panel.
DevTools now provides color suggestions for low color contrast text.
Imported font faces are now added to the list of CSS auto-completion when editing the font-family
property in the Styles pane.
What’s New in Chrome 87, Available Now
The new PDF view includes a sidebar that shows a preview of all the pages. The zoom buttons are now at the top of the screen along with a rotate button and “Fit to Page” option. The menu also includes a new option to view pages side-by-side.
Chrome 87 rolling out with significant speed improvements, more battery life - 9to5Google
New in Chrome 87 | Web | Google Developers
Once the user has granted permission, you can then call videoTrack.applyConstraints()
to adjust the pan, tilt, and zoom.
Starting in Chrome 87, passing range requests through to the network from inside a service worker will "just work."
With the font access API, a site can now enumerate the installed fonts, giving users access to all of the fonts on their system.
What's New In DevTools (Chrome 87) | Web | Google Developers
When an HTML element on your page has display: grid
or display: inline-grid
applied to it, you can see a grid
badge next to it in the Elements panel. Click the badge to toggle the display of a grid overlay on the page.
The new Layout pane has a Grid section offering you a number of options for viewing the grids.
Select More options > More tools > WebAuthn to open the WebAuthn tab.
DevTools now support moving tools in DevTools between the top and bottom panel. This way, you can view any two tools at once.
The Computed sidebar pane in the Styles pane is collapsed by default.
You can now group the CSS properties by categories in the Computed pane.
resource-type
and url
filters in the Network panelWhat’s New in Chrome 88, Available Now
chrome://flags/#enable-tab-search
Chrome 88 rolling out: Edit saved passwords, ends Mac OS X 10.10 support - 9to5Google
Chrome is now letting users manually “Edit password” from the central list on chrome://settings/passwords.
What’s New in Chrome 89, Available Now
Chrome 89 rolling out: Reading list, Tab Search, more - 9to5Google]
You can tap the dropdown icon in the top-right corner or use Shift+Command+A (Mac) to get a list of pages open across all windows. The browser displays five at a time, while you can also quickly close tabs from this view. If it’s not yet live, manually turn it on:
chrome://flags/#enable-tab-search
What’s New in Chrome 90, Available Now
Chrome 90 on the desktop has support for the AV1 Encoder, which uses the WebRTC standard and is optimized for video calling.
Chrome 90 will attempt to load websites over HTTPS by default.
Chrome 90 rolling out: AV1 encoder optimized for video calls, easily hide Reading List - 9to5Google
New in Chrome 90 - Chrome Developers
overflow:flip
.overflow-clip {
overflow: clip;
}
Using overflow: clip
makes it possible for you to prevent any type of scrolling for the box, including programmatic scrolling. That means the box is not considered a scroll container; it does not start a new formatting context, which gives it better performance than overflow: hidden
.
<host-element>
<template shadowroot="open">
<slot></slot>
</template>
<h2>Light content</h2>
</host-element>
What's New In DevTools (Chrome 90) - Chrome Developers
In addition, the Layout pane has a Flexbox section, display all the flexbox elements on the page.
What’s New in Chrome 91, Available Now
Previously, if you wanted to attach a file to an email, you’d have to drag it from the file explorer and drop it in the email tab. You can now simply Ctrl+C to copy and Ctrl+V to paste it.
A new option in the menu will allow you to “Follow” a website. Whenever that site published new content, it will show up in the new “Following” section on the New Tab page.
Chrome 91 rolling out: freeze Tab Groups, Android tablets load desktop sites - 9to5Google
When Tab Groups are collapsed to take up less space, Chrome 91 will freeze those pages to free up system resources.
Chrome on Android tablets now requests the desktop versions of sites rather than the mobile variant if the screen size is large enough. Smaller tablets will continue to request the phone version.
New in Chrome 91 - Chrome Developers
Pass a suggestedName
property as part of the showSaveFilePicker
options.
const fileHandle = await self.showSaveFilePicker({
suggestedName: 'Untitled Text.txt',
types: [{
description: 'Text documents',
accept: {
'text/plain': ['.txt'],
},
}],
});
The same goes for the default starting directory.
const fileHandle = await self.showOpenFilePicker({
startIn: 'documents'
});
window.addEventListener('paste', onPaste);
async function onPaste(e) {
const file = e.clipboardData.files[0];
const contents = await file.text();
...
}
Host the assetlinks.json
file in the .well-known
folder for each domain.
What's New In DevTools (Chrome 91) - Chrome Developers
You can now toggle the scroll-snap
badge in the Elements panel to inspect the CSS scroll-snap alignment.
Use the new Memory inspector to inspect an ArrayBuffer
in JavaScript, as well as the Wasm memory.
You can now selectively enable or disable badges via the Badge settings in the Elements panel.
Image previews in the Elements panel now displays more information on the image - rendered size, rendered aspect ratio, intrinsic size, intrinsic aspect ratio, and file size.
Content-Encoding
sA new network conditions button is added in the Network panel. Click on it to open the Network conditions tab.
A new Accepted Content-Encodings option is added to the Network conditions tab.
[]
notationWhat’s New in Chrome 92, Available Now (howtogeek.com)
It’s common to get asked which app you want to use to open a file on your Android device. Now, you’ll also see web apps as available options.
Memories is available under a flag (chrome://flags/#memories
) on the desktop. Once it’s enabled, you can go to chrome://memories
, and you’ll see a brand new UI for your history.
Instead of finding an RSS feed and adding it to your RSS reader of choice, you can simply “Follow” a website from Chrome, and new content will appear on the “New Tab” page under the “Following” tab.
Chrome 92 rolling out: Better permission, Sharing Hub, more - 9to5Google
What's New In DevTools (Chrome 92) - Chrome Developers
const
redeclarations in the ConsoleYou can now view the order of source elements on screen for better accessibility inspection.
View iframe details by right clicking on the iframe element in the Elements panel, and select Show frame details.
This takes you to a view of the iframe's details in the Application panel where you can examine document details, security & isolation status, permissions policy, and more to debug potential issues.
Cross-origin resource sharing (CORS) errors are now surfaced in the Issues tab. There are various reasons causing CORS errors. Click to expand each issue to understand the potential causes and solutions.
The XHR label is now renamed to Fetch/XHR. This change makes it clearer that this filter includes both XMLHttpRequest
and Fetch API network requests.
What’s New in Chrome 93, Available Now (howtogeek.com)
Google rolling out Chrome 93 on Mac, Windows, Android, iOS - 9to5Google
New in Chrome 93 - Chrome Developers
You can now load CSS style sheets with import
statements, just like JavaScript modules.
Unlike other ways of applying CSS from JavaScript, there is no need to create elements, or mess with JavaScript strings of CSS text.
To use it, import the style sheet with assert {type: 'css'}
, then apply it to the document
or shadowRoot
by calling adoptedStyleSheets
.
import sheet from './styles.css' assert { type: 'css' };
document.adoptedStyleSheets = [sheet];
shadowRoot.adoptedStyleSheets = [sheet];
But beware, if you leave off the assert
- the file will be treated as JavaScript, and won't work!
The Multi-Screen Window Placement API makes it possible to enumerate the displays connected to the users machine, and place windows on specific screens.
You can quickly check if there's more than one screen connected to the device:
const isExtended = window.screen.isExtended;
// returns true/false
But, the key functionality is in window.getScreens()
, which provides all the details about the attached displays.
const screens = await window.getScreens();
// returns
// {
// currentScreen: {...}
// oncurrentscreenchange: null
// onscreenschange: null
// screens: [{...}, {...}]
// }
For example, you can determine the primary screen, then use requestFullscreen()
to display an element on that screen.
try {
const screens = await window.getScreens();
const primary = screens.filter((screen) => screen.primary)[0];
await elem.requestFullscreen({ screen: primary });
} catch (err) {
console.error(err);
}
And it provides a way to listen for changes, for example if a new display is plugged in, or removed.
const screens = await window.getScreens();
let numScreens = screens.screens.length;
screens.addEventListener('screenschange', (event) => {
if (screens.screens.length !== numScreens) {
console.log('Screen count changed');
numScreens = screens.screens.length;
}
});
What's New In DevTools (Chrome 93) - Chrome Developers
You can now view and edit CSS container queries in the Styles pane.
Container queries provide a much more dynamic approach to responsive design. The @container
at-rule works in a similar way to a media query with @media
. However, instead of querying the viewport and user agent for information, @container
queries the ancestor container that matches certain criteria.
Web bundle is a file format for encapsulating one or more HTTP resources in a single file. You can now preview the web bundle content in the Network panel.
New context menu in the Console allows you to copy any string in as content, JavaScript literal or JSON literal.
You can now pretty print JSON responses in the Network panel.
Open a JSON response in the Network panel, click on the {}
icon to pretty-print it.
What’s New in Chrome 94, Available Now (howtogeek.com)
The new card is called “From Your Google Drive” and it shows the three most recently opened documents and files.
Chrome 94 rolling out as first release in the new 4-week update cycle - 9to5Google
New in Chrome 94 - Chrome Developers
The Web Codecs API makes it possible to use the media components and codecs that are already in the browser.
WebGPU is a new API that exposes modern graphics capabilities, specifically Direct3D 12, Metal, and Vulkan. You can think of it like WebGL, but it provides access to more advanced features of the GPU, and it also provides support for performing general computations on the GPU.
What's New In DevTools (Chrome 94) - Chrome Developers
Chrome DevTools now supports more than 80 languages, allowing you to work in your preferred language!
Open Settings, then select your preferred language under the Preferences > Language dropdown and reload DevTools.
A new container badge is added next to the container elements (the ancestor elements that match the criteria of @container
at-rules). Click the badge to toggle the display of an overlay of the chosen container and all its querying descendants on the page.
Use the new Invert checkbox to invert the filters in the Network panel.
What’s New in Chrome 95, Available Now (howtogeek.com)
New in Chrome 95 - Chrome Developers
URLPattern
const p = new URLPattern({
protocol: 'https',
hostname: 'example.com',
pathname: '/:folder/*/:fileName.jpg',
search: '*',
hash: '*',
});
const url = '/document/d/1s...5c/edit#heading=h.8...c';
const pattern = new URLPattern({
pathname: '/:kind/d/:fileID/:mode',
hash: '*',
});
const r = pattern.exec(url);
const eyeDropper = new EyeDropper();
const result = await eyeDropper.open();
What's New In DevTools (Chrome 95) - Chrome Developers
Hover over the unit type, and notice the unit type is underlined. Click on it to select a unit type from the dropdown.
Hover over the unit value, and your mouse pointer is changed to horizontal cursor. Drag horizontally to increase or decrease the value. To adjust the value by 10, hold the Shift key when dragging.
In the Issues tab, hover over on an issue you would like to hide. Click on More options > Hide issues like this.
DevTools improve the display of properties by:
The snippets in the Snippets pane under the Sources panel are now sorted alphabetically. Previously, it’s not sorted.
It’s using a new cache that [saves sites you recently visited](https://www.chromestatus.com/features/6279906713403392) on your computer. That way, when you go back or forward, they’ll be ready quicker. This will come at the cost of Chrome using even more RAM, but it may be worth it.
Chrome 96 fixes this behavior. PNG files you paste into Chrome will retain all the associated metadata.
A new flag allows you to add exceptions for sites that you don’t want to display in dark mode.
[New in Chrome 96 - Chrome Developers](https://developer.chrome.com/blog/new-in-chrome-96/)
id
for PWAsAdd a protocol_handlers
property to your web app manifest, specify the protocol
you want to handle, and the url
that should be opened when clicked.
{
"protocol_handlers": [
{
"protocol": "web+tea",
"url": "/tea?type=%s"
},
{
"protocol": "web+coffee",
"url": "/coffee?type=%s"
}
]
}
Priority Hints are an experimental feature, available as an origin trial starting in Chrome 96, and can help optimize the Core Web Vitals. The importance
attribute allows you to specify the priority for resource types such as CSS, fonts, scripts, images, and iframes.
<!-- We don't want a high priority for this above-the-fold image -->
<img src="/not-important.svg" importance="low">
<!-- Initiate an early fetch for a resource, but de-prioritize it -->
<link rel="preload" href="/script.js" as="script" importance="low">
<script>
fetch('https://example.com/', {importance: 'high'})
.then(data => {
// Trigger a high priority fetch
});
</script>
Use the new CSS Overview panel to identify potential CSS improvements on your page. Open the CSS Overview panel, then click on Capture overview to generate a report of your page’s CSS.
The copy CSS and edit as text experience are restored for CSS properties with length.
The prefers-contrast media feature is used to detect if the user has requested more or less contrast in the page.
Use DevTools to emulate auto dark theme to easily see how your page looks when Chrome’s Auto Dark Theme is enabled.
Two new options are added in the context menu for you to easily copy CSS rules as JavaScript properties. These shortcuts options are handy especially for developers who are working with [CSS-in-JS](https://developer.chrome.com/blog/css-in-js/#what-is-css-in-js) libraries.
In the Styles pane, right click on a CSS rule. You can select Copy declaration as JS to copy a single rule or Copy all declarations as JS to copy all rules.
Use the new Payload tab in the Network panel when you inspect a network request with payload.
The Properties pane now shows only relevant properties instead of showing all properties of the instance. DOM prototypes and methods are now removed.
You can hide CORS errors in the Console.
In the Console, click on the Settings icon and uncheck the Show CORS errors in console checkbox.
[Intl](https://tc39.es/ecma402/#intl-object)
objects preview and evaluation in the ConsoleThe Intl objects have proper preview now and are evaluated eagerly in the Console.
The Console now reports async
stack traces for async
functions to be consistent with other async tasks, and consistent with what's shown in the Call Stack..
Google Chrome version history - Wikipedia
Chrome | Google Blog
Chromium Blog
Chrome Enterprise release notes - Google Chrome Enterprise Help
Google Chrome - 9to5Google