Skip to content

Instantly share code, notes, and snippets.

@Inventsable
Created October 15, 2020 23:19
Show Gist options
  • Save Inventsable/c1216f5f9cc5fae7eecc89a30ab87858 to your computer and use it in GitHub Desktop.
Save Inventsable/c1216f5f9cc5fae7eecc89a30ab87858 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<!-- This is the main HTML code inside the installed extension location -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>testDocker</title>
</head>
<body style="margin: 0; border: 0; overflow:hidden;">
<!-- We create an iframe to fill the available space and give it an id -->
<iframe
id="frame"
frameborder="0"
enable-nodejs
style="border: 0; width: 100vw; height: 100vh; box-sizing: border-box;"
></iframe>
</body>
<script>
// Avoid any require statements below being errors:
window.require = require || cep_node.require;
// Get the root path to .../AppData/Roaming
const root = window.__adobe_cep__.getSystemPath("userData");
// Find the location of your temp panel production HTML (which has the real/primary content of our panel)
let targPath = `${root}/testRemote/dist/index.html`;
// Assign the above iframe's src to that path
document.getElementById("frame").src = targPath;
/*
Done. We can arbitrarily rewrite the AppData panel contents at any time then refresh this one for a "self-updating panel".
This is a very simplified way to do this -- it doesn't account for downloading the real panel if it doesn't exist,
and doesn't display anything unless the real panel exists. It could be far better as a standalone placeholder template
with a loading indicator and utilities for checking the real panel -- possibly as a standalone component which switches
itself to the iframe contents or else will display a loading indicator.
*/
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment