Check if viewer is embedded only once and cache the result
Merge pull request #3495 from Snuffleupagus/check-if-viewer-embedded

Check if viewer is embedded only once and cache the result