Today I’d like to show very small extension that can be useful for some editors. In edit mode, when clicking “view on website”, the page is opened in same window. Of course using quick navigation button Editors can go back to the same edit place, but for some people this behavior can be annoying. I prepared few lines of code, that allows to open pages in new window.
view on website

Adding snippet to the solution

To use snippet you have to copy initializer.js file to the Client Resources Script folder.

Code will modify “target” attribute of “view on website” link and set it to “_blank”.

Below is the screenshot from alloy solution that contains initializer file.
view on website structure

Then you need to modify the module.config file and add “initializer” attribute to clientModule node.

After running the site, pages will be opened in new window.