You need to sign in to do that
Don't have an account?
Jamie Cohan
How to fix 'blank' iframe in Lightning?
Hi
When we move from Salesforce Classic to Lightning the <Iframe > does not display.
The page that does not work is: <apex:iframe src="{!FrameLink}" />
In Classic Salesforce the Iframe works. Our application has a side menu and the user clicks on the function they want and the resulting iframe page is shown in the 'console window'
When we switched to Lightning the console in the picture above is blank i.e. the page in the <iframe > is blank in 'Chrome' and in Microsoft Edge the console says "This content can't be shown in frame"...
In the developer console in the Chrome browser there is the following error:
na7.salesforce.com/a08A000001CZFnkIAH:1 Refused to display 'https://na7.lightning.force.com/one/one.app#/alohaRedirect/a08A000001CZFnkIAH' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
How do fix this iframe issue?
Microsoft Edge Browser
In Chrome the browser
When we move from Salesforce Classic to Lightning the <Iframe > does not display.
The page that does not work is: <apex:iframe src="{!FrameLink}" />
In Classic Salesforce the Iframe works. Our application has a side menu and the user clicks on the function they want and the resulting iframe page is shown in the 'console window'
When we switched to Lightning the console in the picture above is blank i.e. the page in the <iframe > is blank in 'Chrome' and in Microsoft Edge the console says "This content can't be shown in frame"...
In the developer console in the Chrome browser there is the following error:
na7.salesforce.com/a08A000001CZFnkIAH:1 Refused to display 'https://na7.lightning.force.com/one/one.app#/alohaRedirect/a08A000001CZFnkIAH' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
How do fix this iframe issue?
Microsoft Edge Browser
In Chrome the browser
I have a simple Option.You will get the User Lightning login experience from UserPreferencesLightningExperiencePreferred Field on user record.
IF Use switch to lightning dnt renders the iframe on the visuaforce page. Otherwise, you can show iframe.Let me know if it will not work for you
Are you saying we set the flag in Apex to False ?
{ User u=[Select ID,UserPreferencesLightningExperiencePreferred from User where id=:UserInfo.getUserId()]; u.UserPreferencesLightningExperiencePreferred = FALSE ;
UserPreferencesLightningExperiencePreferred— When true, redirects the user to the Lightning Experience interface. Label is Switch to Lightning Experience.
OR
are you saying that there is a field on the user object layout that we disable to UserPreferencesLightningExperiencePreferred = false?
Because I don't see a property on the user property form.
Are you saying that we write apex code to set the UserPreferencesLightningExperiencePreferred to False
User u=[Select ID,UserPreferencesLightningExperiencePreferred from User where id=:UserInfo.getUserId()]; u.UserPreferencesLightningExperiencePreferred = False
// UserPreferencesLightningExperiencePreferred— When true, redirects the user to the Lightning Experience interface. Label is Switch to Lightning Experience.
OR
Are you saying there is a field on User Settings Layout that has a field UserPreferencesLightningExperiencePreferred that we set to False ?
Because I don't see it on the layout
UserPreferencesLightningExperiencePreferred --->> When true, redirects the user to the Lightning Experience interface. The label is Switch to Lightning Experience. This field is available in API version 35.0 and later
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_user.htm