diff --git a/js/responsive-preview.js b/js/responsive-preview.js index 01afcda..8f50d6d 100644 --- a/js/responsive-preview.js +++ b/js/responsive-preview.js @@ -669,9 +669,9 @@ Drupal.responsivePreview = Drupal.responsivePreview || { // Append the container to the body to initialize the iframe document. .appendTo('body'); // Load the path into the iframe. - // Create a path from the basePath and the current path, chopping off the - // trailing slash of the basePath. The pathname already includes it. - $frame.get(0).contentWindow.location = Drupal.settings.basePath.slice(0, -1) + window.location.pathname; + // Create a path from the basePath and the current path, trimming the + // base away from the pathname to avoid duplication. + $frame.get(0).contentWindow.location = Drupal.settings.basePath + window.location.pathname.replace(Drupal.settings.basePath, ''); // Mark the preview element processed. this.model.set('isBuilt', true); },