1

I'm creating some custom ribbon buttons for the experience editor in version 10.1. I have set them up using a combination of the below guides...

https://sitecorebaek.wordpress.com/tag/speak/

https://sbhatiablogs.wordpress.com/2019/09/02/add-a-custom-button-on-experience-editor-ribbon/

https://alan-null.github.io/2016/09/hide-experience-editor-tab

So far so good, the buttons are visible and the click event is triggered in the below using the below code:

define(["sitecore", "/-/speak/v1/ExperienceEditor/ExperienceEditor.js",
"/-/speak/v1/ExperienceEditor/ExperienceEditor.Context.js"
, "/-/speak/v1/ExperienceEditor/ExperienceEditorProxy.js"],
function (Sitecore, ExperienceEditor, ExperienceEditorContext, ExperienceEditorProxy) {

    console.log("FieldEditorCommand.js loaded...");

    Sitecore.Commands.LaunchFieldEditor =
    {
        canExecute: function (context) {
            return true;
        },
        execute: function (context) {

            try {

                console.dir(context.button);

                const rawString = context.button.attributes.name;

                if (rawString.length) {

                    const fieldsString = rawString.replace("-", "|");
                    const itemId = context.currentContext.itemId.replace("%7b", "{").replace("%7d", "}")

                    ExperienceEditorProxy._pe().postRequest('webedit:fieldeditor(command = ' + itemId + ', fields = ' + fieldsString + ', id = ' + itemId + ')', null, false)

                }
            }
            catch (err) {
                console.log("FieldEditorCommandError", err);
            }
        }
    };
});

My issue is when executing the post back to Sitecore using ExperienceEditorProxy._pe().postRequest();, I get the following error:

Failed to call scGetFrameValue in IFrame tag. This typically happens due to a Permission Denied exception in IE9 caused by an intricate issue with Popup and ShowModalDialog calls. Blocked a frame with origin "https://cm.ljmu.localhost" from accessing a cross-origin frame.

The origin is always cm.ljmu.localhost so that's not the problem. I also read that it could be a conflict with Jquery however removing jquery from experience editor pages does not resolve the issue.

3
  • Could you please confirm if the error msg is from the browser dev tools ->console window
    – Abhay Dhar
    Commented Aug 5, 2022 at 6:07
  • Yes it's the browser reporting it in the console (blue), not an error log (red) @AbhayDhar
    – Sean T
    Commented Aug 5, 2022 at 11:12
  • I am not too familiar with SPEAK but it looks like you have a error with the CSP set on your Sitecore instance or you are returning X-FRAME-OPTIONS to DENY in http response headers
    – Abhay Dhar
    Commented Aug 5, 2022 at 17:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.