Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions javascript-injectors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,10 @@ $ screenly asset inject-js "$ASSET_ID" "$JAVASCRIPT_URL"

* Download [cyfe-sign-in-via-credentials.js](https://github.com/Screenly/Playground/tree/master/javascript-injectors/examples/cyfe-sign-in-via-credentials.js) and modify it with your credentials.
* Run `screenly asset inject-js "$ASSET_ID" /path/to/script.js` to add the JavaScript

## Google Maps cookies consent closing

```bash
* export JAVASCRIPT_URL='https://github.com/Screenly/playground/tree/master/javascript-injectors/examples/googlemaps-cookies-consent-closing.js'
$ screenly asset inject-js "$ASSET_ID" "$JAVASCRIPT_URL"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function closeConsentbox () {
const acceptCookie = document.querySelector('button[aria-label="Accept all"]')
if (acceptCookie) {
acceptCookie.click()
}
}
setInterval(closeConsentbox(), 2000)