function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Test Dev 81Test Dev 81 

Hide visualforce page if user in lightning context

hi Everyone,
I have created a visualfroce and added on the Opportunity page layout
but I want to hide this visualforce page if the user on the lightning opportunity  page 
means show VF page if the user in classic only
bellow my vf code I added rendered tab but still i can  see this page in lightning 
 <apex:page showHeader="false" standardController="Opportunity" extensions="Rg_TestMemberAccountCreate" sidebar="false" docType="html-5.0" rendered="{! $User.UIThemeDisplayed != 'Theme4d' }">
    <html>
        <head>
            <style>
            </style>
            <apex:slds />
        </head>
        <body>
            <apex:form >
                <div class="slds-align_absolute-center" >
                    <div class="slds-grid">
                        <div class="slds-col slds-p-around_small" >
                            <apex:commandButton value="Enable Test" styleClass="slds-button_neutral slds-text-font_monospace" style="height:1.5rem" disabled="{!showTest}" action="{!callTest}"/>
                            <apex:commandButton value="Enable Production" styleClass="slds-button_neutral slds-text-font_monospace" style="height:1.5rem" disabled="{!showProd}" action="{!callProd}"/>
                            <div id="apiError" style="color: red;" rendered ="{!showProd}">{!apiError}</div>
                        </div>
                    </div>
                </div>
            </apex:form>
        </body>
    </html>
</apex:page>
 
ANUTEJANUTEJ (Salesforce Developers) 
Hi there,

Can you try unchecking the  "Available for Lightning Experience, Lightning Communities, and the mobile app" checkbox on vf page.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.