Skip to content

Instantly share code, notes, and snippets.

@Nashorn
Nashorn / aop.js
Created September 16, 2021 07:14 — forked from dschnare/aop.js
AopJS - A lightweight aspect oriented programming (AOP) API for JavaScript.
// Author: Darren Schnare
// Keywords: aop,aspect,oriented,programming,javascript,pointcut
// License: MIT ( http://www.opensource.org/licenses/mit-license.php )
// Repo: https://gist.github.com/1235559
// Inspiration: http://karlagius.com/2008/04/25/aspect-oriented-programming-in-javascript/
// Reference: http://docs.jboss.org/jbossaop/docs/2.0.0.GA/docs/aspect-framework/reference/en/html/advices.html
// Reference: http://static.springsource.org/spring/docs/2.0.x/reference/aop.html
// Appends the aop namespace to the specified scope (defaults to global).
@Nashorn
Nashorn / findall_elements_deep.js
Created October 30, 2020 09:25 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom.
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*/
/**
* Finds all elements on the page, inclusive of those within shadow roots.
* @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main'
* @return {!Array<string>} List of anchor hrefs.
*/
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */