Personalization – Customization by clicking on the section, navigate to another URL?

I found this code https://make.xwp.co/2016/07/21/navigating-to-a-url-in-the-customizer-preview-when-a-section-is-expanded/ that explains how to do this . But for some reason it does not work for me. Checking the console I can see that the page is "changed", OBTAINIt is the URL that I have put and I loaded it. But it is not displayed in the Customizer. I'm still stuck on the same page that I started.

This is the code:

PHP to queue the script:

function custom_check_in_enqueue () {
wp_enqueue_script (& # 39; customize-check-in & # 39 ;, get_template_directory_uri (). & # 39; /javascripts/admin/customize-check-in.js&#39 ;, array (& # 39; jquery & # 39 ;, & # 39; customize-controls & # 39;), false, true);
}
add_action (& # 39; custom_controls_enqueue_scripts & # 39 ;, & # 39; custom_check_in_enqueue & # 39;);

Javascript:

                (function (api) {
api.section (& # 39; checkin & # 39 ;, function (section) {
var previousUrl, clearPreviousUrl, previewUrlValue;
previewUrlValue = api.previewer.previewUrl;
clearPreviousUrl = function () {
previousUrl = null;
};

section.expanded.bind (function (isExpanded) {
var url;
if (expands) {
url = (api.settings.url.home + & # 39; check-in & # 39;);
previousUrl = previewUrlValue.get ();
previewUrlValue.set (url);
previewUrlValue.bind (clearPreviousUrl);
} else {
previewUrlValue.unbind (clearPreviousUrl);
if (previousUrl) {
previewUrlValue.set (previousUrl);
}
}
});
});
} (wp.customize));

So it seems that everything works when the console is checked. But it's not like that.
Any ideas?