If you get a requirement to disable PhantomJS on your Content Delivery environments, this trick will do it.
How PhantomJS is implemented with Sitecore:
Content Testing in Sitecore uses the Phantom JS tool for generation of the screenshot image files. In case you didn’t know, Sitecore has had screenshot generation features for quite some time. We use it to generate icons for items that you’ll be listing in the UI like renderings. These icon generation features are based on the System.Windows.Forms.WebBrowser
control built into .net. So why did we not use the existing screenshot features for Content Testing? In early testing we found discrepancies with the WebBrowser
control. WebBrowser
uses Internet Explorer installed on the server where Sitecore is running. But the specific version that it uses isn’t always the latest. There are registry updates one can make to force the appropriate IE version, but this seemed like a big ask of users. This was one of the reasons we chose to use Phantom JS instead.
All you have to do, is create a patch file that will disable getScreenshotForUrl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"> | |
<sitecore role:require="ContentDelivery or Reporting or Processing"> | |
<settings> | |
<setting name="ContentTesting.AutomaticContentTesting.Enabled" value="false" /> | |
<setting name="ContentTesting.AlwaysShowTestCandidateNotification" value="false" /> | |
</settings> | |
<pipelines> | |
<renderingRuleEvaluated> | |
<processor type="Sitecore.ContentTesting.Pipelines.RenderingRuleEvaluated.TestingRule, Sitecore.ContentTesting"> | |
<patch:delete /> | |
</processor> | |
</renderingRuleEvaluated> | |
<getScreenShotForURL> | |
<patch:delete /> | |
</getScreenShotForURL> | |
</pipelines> | |
</sitecore> | |
</configuration> |
Copy the above code into the configuration file and name it whatever you want and it into App_Config\Include\zzz
Reference: