|
36 | 36 |
|
37 | 37 | <input type="text" id="nav-search" placeholder="Search" />
|
38 | 38 |
|
39 |
| - <h2><a href="index.html">Home</a></h2><h2><a href="https://prismjs.com" class="menu-item" id="website_link" >PrismJS</a></h2><h2><a href="https://github.com/PrismJS/prism" target="_blank" class="menu-item" id="github_link" >GitHub</a></h2><h3>Classes</h3><ul><li><a href="Token.html">Token</a></li></ul><h3>Namespaces</h3><ul><li><a href="Prism.html">Prism</a><ul class='members'><li data-type='member'><a href="Prism.html#.manual">manual</a></li></ul><ul class='methods'><li data-type='method'><a href="Prism.html#.highlight">highlight</a></li><li data-type='method'><a href="Prism.html#.highlightAll">highlightAll</a></li><li data-type='method'><a href="Prism.html#.highlightAllUnder">highlightAllUnder</a></li><li data-type='method'><a href="Prism.html#.highlightElement">highlightElement</a></li><li data-type='method'><a href="Prism.html#.tokenize">tokenize</a></li></ul></li><li><a href="Prism.hooks.html">hooks</a><ul class='methods'><li data-type='method'><a href="Prism.hooks.html#.add">add</a></li><li data-type='method'><a href="Prism.hooks.html#.run">run</a></li></ul></li><li><a href="Prism.languages.html">languages</a><ul class='methods'><li data-type='method'><a href="Prism.languages.html#.extend">extend</a></li><li data-type='method'><a href="Prism.languages.html#.insertBefore">insertBefore</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#Grammar">Grammar</a></li><li><a href="global.html#GrammarToken">GrammarToken</a></li><li><a href="global.html#HighlightCallback">HighlightCallback</a></li><li><a href="global.html#HookCallback">HookCallback</a></li><li><a href="global.html#TokenStream">TokenStream</a></li></ul> |
| 39 | + <h2><a href="index.html">Home</a></h2><h2><a href="https://prismjs.com" class="menu-item" id="website_link" >PrismJS</a></h2><h2><a href="https://github.com/PrismJS/prism" target="_blank" class="menu-item" id="github_link" >GitHub</a></h2><h3>Classes</h3><ul><li><a href="Token.html">Token</a></li></ul><h3>Namespaces</h3><ul><li><a href="Prism.html">Prism</a><ul class='members'><li data-type='member'><a href="Prism.html#.disableWorkerMessageHandler">disableWorkerMessageHandler</a></li><li data-type='member'><a href="Prism.html#.manual">manual</a></li></ul><ul class='methods'><li data-type='method'><a href="Prism.html#.highlight">highlight</a></li><li data-type='method'><a href="Prism.html#.highlightAll">highlightAll</a></li><li data-type='method'><a href="Prism.html#.highlightAllUnder">highlightAllUnder</a></li><li data-type='method'><a href="Prism.html#.highlightElement">highlightElement</a></li><li data-type='method'><a href="Prism.html#.tokenize">tokenize</a></li></ul></li><li><a href="Prism.hooks.html">hooks</a><ul class='methods'><li data-type='method'><a href="Prism.hooks.html#.add">add</a></li><li data-type='method'><a href="Prism.hooks.html#.run">run</a></li></ul></li><li><a href="Prism.languages.html">languages</a><ul class='methods'><li data-type='method'><a href="Prism.languages.html#.extend">extend</a></li><li data-type='method'><a href="Prism.languages.html#.insertBefore">insertBefore</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#Grammar">Grammar</a></li><li><a href="global.html#GrammarToken">GrammarToken</a></li><li><a href="global.html#HighlightCallback">HighlightCallback</a></li><li><a href="global.html#HookCallback">HookCallback</a></li><li><a href="global.html#TokenStream">TokenStream</a></li></ul> |
40 | 40 | </nav>
|
41 | 41 |
|
42 | 42 | <div id="main">
|
@@ -155,6 +155,93 @@ <h3 class="subsection-title">Members</h3>
|
155 | 155 |
|
156 | 156 |
|
157 | 157 |
|
| 158 | +<h4 class="name" id=".disableWorkerMessageHandler"><span class="type-signature">(static) </span>disableWorkerMessageHandler<span class="type-signature"> :boolean</span></h4> |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | +<dl class="details"> |
| 165 | + |
| 166 | + |
| 167 | + <dt class="tag-source">Source:</dt> |
| 168 | + <dd class="tag-source"><ul class="dummy"><li> |
| 169 | + <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line73">line 73</a> |
| 170 | + </li></ul></dd> |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + <dt class="tag-default">Default Value:</dt> |
| 197 | + <dd class="tag-default"><ul class="dummy"> |
| 198 | + <li>false</li> |
| 199 | + </ul></dd> |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | +</dl> |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | +<div class="description usertext"> |
| 214 | + <p>By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses |
| 215 | +<code>addEventListener</code> to communicate with its parent instance. However, if you're using Prism manually in your |
| 216 | +own worker, you don't want it to do this.</p> |
| 217 | +<p>By setting this value to <code>true</code>, Prism will not add its own listeners to the worker.</p> |
| 218 | +<p>You obviously have to change this value before Prism executes. To do this, you can add an |
| 219 | +empty Prism object into the global scope before loading the Prism script like this:</p> |
| 220 | +<pre class="prettyprint source lang-js"><code>window.Prism = window.Prism || {}; |
| 221 | +Prism.disableWorkerMessageHandler = true; |
| 222 | +// Load Prism's script |
| 223 | +</code></pre> |
| 224 | +</div> |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + <h5>Type:</h5> |
| 229 | + <ul> |
| 230 | + <li> |
| 231 | + |
| 232 | +<span class="param-type">boolean</span> |
| 233 | + |
| 234 | + |
| 235 | + </li> |
| 236 | + </ul> |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
158 | 245 | <h4 class="name" id=".manual"><span class="type-signature">(static) </span>manual<span class="type-signature"> :boolean</span></h4>
|
159 | 246 |
|
160 | 247 |
|
@@ -263,7 +350,7 @@ <h4 class="name" id=".highlight"><span class="type-signature">(static) </span>hi
|
263 | 350 |
|
264 | 351 | <dt class="tag-source">Source:</dt>
|
265 | 352 | <dd class="tag-source"><ul class="dummy"><li>
|
266 |
| - <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line616">line 616</a> |
| 353 | + <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line637">line 637</a> |
267 | 354 | </li></ul></dd>
|
268 | 355 |
|
269 | 356 |
|
@@ -480,7 +567,7 @@ <h4 class="name" id=".highlightAll"><span class="type-signature">(static) </span
|
480 | 567 |
|
481 | 568 | <dt class="tag-source">Source:</dt>
|
482 | 569 | <dd class="tag-source"><ul class="dummy"><li>
|
483 |
| - <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line458">line 458</a> |
| 570 | + <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line479">line 479</a> |
484 | 571 | </li></ul></dd>
|
485 | 572 |
|
486 | 573 |
|
@@ -676,7 +763,7 @@ <h4 class="name" id=".highlightAllUnder"><span class="type-signature">(static) <
|
676 | 763 |
|
677 | 764 | <dt class="tag-source">Source:</dt>
|
678 | 765 | <dd class="tag-source"><ul class="dummy"><li>
|
679 |
| - <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line477">line 477</a> |
| 766 | + <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line498">line 498</a> |
680 | 767 | </li></ul></dd>
|
681 | 768 |
|
682 | 769 |
|
@@ -911,7 +998,7 @@ <h4 class="name" id=".highlightElement"><span class="type-signature">(static) </
|
911 | 998 |
|
912 | 999 | <dt class="tag-source">Source:</dt>
|
913 | 1000 | <dd class="tag-source"><ul class="dummy"><li>
|
914 |
| - <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line523">line 523</a> |
| 1001 | + <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line544">line 544</a> |
915 | 1002 | </li></ul></dd>
|
916 | 1003 |
|
917 | 1004 |
|
@@ -1157,7 +1244,7 @@ <h4 class="name" id=".tokenize"><span class="type-signature">(static) </span>tok
|
1157 | 1244 |
|
1158 | 1245 | <dt class="tag-source">Source:</dt>
|
1159 | 1246 | <dd class="tag-source"><ul class="dummy"><li>
|
1160 |
| - <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line652">line 652</a> |
| 1247 | + <a href="prism-core.js.html">prism-core.js</a>, <a href="prism-core.js.html#line673">line 673</a> |
1161 | 1248 | </li></ul></dd>
|
1162 | 1249 |
|
1163 | 1250 |
|
|
0 commit comments