AEM Author Mode Browser Shortcuts

As an Adobe Experience Manager user or developer you will probably find yourself switching frequently between Author and Preview modes while testing new page content. The preview mode is great but the most accurate representation of a published AEM page is when the WCMMode is completely disabled.

While the WCMMode can be manually controlled via appending the following query string onto your page url, ?wcmmode=disabled, it is cumbersome to keep toggling this on and off when you want to preview something quickly. So, one of the first things I looked for when I started developing for AEM was a way to quickly switch between these modes via a browser extension so I didn’t have to keep adding it manually. I found an article written back before touch UI had been created for AEM which lets you toggle the WCMMode via a bookmarklet. ( This worked great for working on classic UI but I needed to update it in order to get it to work with touch UI.

The end result is this javascript snippet,

var DISABLED = 'wcmmode=disabled';
  var EDITOR = '/editor.html';
  // Creates the path by combining the path and query string parameters
  var createURL = function(path, qs, hash) {
    var url = path;
    if(qs.length != 0 && !(qs.length == 1 && qs[0] == '')) {
      url += '?' + qs.join('&');
    url += hash;
    return url;
   var hash = '';
   var parameters = [];
   if ( != '') {
     parameters ='&');
  var path = '';
  if (window.location.pathname.substring(0, EDITOR.length) != EDITOR) {
    // We are not in author mode
    path = EDITOR + window.location.pathname;
    if(parameters.indexOf(DISABLED) != -1){
      // remove the wcmmode disabled parameter
    hash = window.location.hash;
  } else {
    // this page is in author mode, get the URL info from the frame
    path = window.location.pathname.substring(EDITOR.length, window.location.pathname.length);
    if( != '') {
      parameters ='&');
    if(parameters.indexOf(DISABLED) == -1){
      // add the disabled parameter
    hash = window.location.hash;
  var url = createURL(path, parameters, hash);
  window.location = url;

To add this to your browser so you can use it as a bookmark just do the following,

  1. Copy the minified version of the above JavaScript code from:
  2. Create a new bookmark in your browser
  3. Use the minified JavaScript code as the page URL
  4. Click the newly created bookmark whenever you want to switch your page from author to preview/disabled mode!


Leave a Reply

Notify of