This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get base url | |
const getUrl = window.location; | |
const baseUrl = getUrl .protocol + "//" + getUrl.host + "/"; | |
// the string you want to append | |
const stringToAdd = "test/" | |
// get all a tags | |
let elements = document.getElementsByTagName('a'); | |
for (let node of elements) { | |
// is this internal to the site? If so update the link | |
if(node.href.startsWith(baseUrl)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const url = process.env.URL || 'https://lit-element.polymer-project.org/'; | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto(url); | |
await page.evaluate(() => { | |
// loop through elements and copy shadow to inner |
NewerOlder