Skip to content

Instantly share code, notes, and snippets.

View lauri-kaariainen's full-sized avatar

Lauri Kääriäinen lauri-kaariainen

View GitHub Profile
@Spencer-Doak
Spencer-Doak / SearchInTheShadows.js
Created May 8, 2021 21:25
Recursively find all shadow roots in a page.
/**
* Recursive depth-first search to find all shadow roots within a webpage.
*
* Example usage: let's imagine you come across a page that has a bunch of
* expandable information sections, and you would like to expand all of those
* info sections for the sake of printing to a PDF or for the ease of
* performing a simple `CTRL+F` search across the information. Let's assume
* those expanding buttons are buried within Shadow DOM. (Perhaps the site is
* using Angular or something of the sort & the buttons are separate
* components, thus by default they end up in a Shadow DOM whenever included.)
@subtleGradient
subtleGradient / BuildSugar.SubtleGradient.js
Created January 15, 2010 12:34
BuildSugar—Provides a bizarrely clean & simple syntax sugar for building HTML/XML strings
/*
---
provides : BuildSugar
version : 0.1alpha1
description : Provides a bizarrely clean & simple syntax sugar for building HTML/XML strings
source : http://gist.github.com/278016
git : git://gist.github.com/278016.git
demo : http://jsfiddle.net/SubtleGradient/4W3RR/
author : Thomas Aylott