You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access Privated Passcode enabled - Klipfolio Power Metrics Dashboard over Edge App.
ToDo:
Fix CORS Issue
Fix IFrame issue
Adde Sentry for logs
PR Type
Enhancement
Description
Add Klipfolio dashboard HTML with iframe
Implement passcode injection and proxy logic
Provide full-screen CSS styling
Add Screenly manifest and instance configurations
Injecting content into an external iframe will fail under cross-origin policy. Ensure the dashboard and host share the same origin or use a messaging API.
letiframeDoc;try{iframeDoc=iframe.contentDocument||iframe.contentWindow.document}catch(e){console.error("Cannot access iframe content due to cross-origin restrictions",e)return}
Using fixed timeouts for loading screenly.js and the iframe can lead to unpredictable behavior. Consider event-based or promise-based loading.
setTimeout(function(){// Get the dashboard iframeconstdashboard=document.getElementById('dashboard')// Construct the URL after screenly.js has loadedletdashboardUrltry{// Try to use Screenly's CORS proxydashboardUrl=screenly.cors_proxy_url+encodeURIComponent(dashboardUrlRaw)}catch(e){// Fallback to direct URL if screenly is not availableconsole.error("Error accessing screenly.cors_proxy_url, using direct URL",e)dashboardUrl=dashboardUrlRaw;}// Set dashboard URLdashboard.src=dashboardUrl// Attempt to inject passcode after iframe loadsdashboard.onload=function(){setTimeout(injectPasscodeIntoIframe,1000)};},500)// 500ms delay for screenly.js to load
-const dashboardUrlRaw = screenly.settings.dashboard_url || 'Dashboard URL not set'+const dashboardUrlRaw = screenly.settings.dashboard_url;+if (!dashboardUrlRaw) {+ console.error("Dashboard URL not set");+ return;+}
Suggestion importance[1-10]: 6
__
Why: Bailing early on a missing URL prevents loading an invalid placeholder string into the iframe, improving robustness.
Low
Check iframe existence
Add a guard after retrieving the dashboard iframe to ensure the element exists before setting properties on it. This prevents null reference errors if the iframe ID is incorrect or missing.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Access Privated Passcode enabled - Klipfolio Power Metrics Dashboard over Edge App.
ToDo:
PR Type
Enhancement
Description
Add Klipfolio dashboard HTML with iframe
Implement passcode injection and proxy logic
Provide full-screen CSS styling
Add Screenly manifest and instance configurations
Changes walkthrough 📝
styles.css
Add full-screen styling CSSedge-apps/klipfolio-power-metrics-dashboard/styles.css
script.js
Implement iframe URL and passcode injectionedge-apps/klipfolio-power-metrics-dashboard/script.js
index.html
Add HTML skeleton with iframeedge-apps/klipfolio-power-metrics-dashboard/index.html
instance.yml
Add app instance configurationedge-apps/klipfolio-power-metrics-dashboard/instance.yml
screenly.yml
Add Screenly manifest settingsedge-apps/klipfolio-power-metrics-dashboard/screenly.yml