diff --git a/javascript-injectors/README.md b/javascript-injectors/README.md index e4180206e..b9164c8d4 100644 --- a/javascript-injectors/README.md +++ b/javascript-injectors/README.md @@ -186,6 +186,13 @@ $ screenly asset inject-js "$ASSET_ID" "$JAVASCRIPT_URL" $ screenly asset inject-js "$ASSET_ID" "$JAVASCRIPT_URL" ``` +## Sign in to Unifi Captive portal + +```bash +* export JAVASCRIPT_URL='https://github.com/Screenly/playground/tree/master/javascript-injectors/examples/unifi-signin-via-credentials.js' +$ screenly asset inject-js "$ASSET_ID" "$JAVASCRIPT_URL" +``` + ## Sign in to Jenkins via credentials Jenkins logo @@ -213,3 +220,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 + +## Tableau cookies consent closing + +```bash +* export JAVASCRIPT_URL='https://github.com/Screenly/playground/tree/master/javascript-injectors/examples/tableau-cookies-consent-closing.js' +$ screenly asset inject-js "$ASSET_ID" "$JAVASCRIPT_URL" +``` diff --git a/javascript-injectors/examples/tableau-cookies-consent-closing.js b/javascript-injectors/examples/tableau-cookies-consent-closing.js new file mode 100644 index 000000000..a190eb442 --- /dev/null +++ b/javascript-injectors/examples/tableau-cookies-consent-closing.js @@ -0,0 +1,7 @@ +function closeConsentbox () { + const acceptCookie = document.querySelector('button[id="onetrust-accept-btn-handler"]') + if (acceptCookie) { + acceptCookie.click() + } +} +setInterval(closeConsentbox(), 2000)