<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://addonstudio.org/mw1/index.php?action=history&amp;feed=atom&amp;title=WoW%3ASecureHandlers</id>
	<title>WoW:SecureHandlers - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://addonstudio.org/mw1/index.php?action=history&amp;feed=atom&amp;title=WoW%3ASecureHandlers"/>
	<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;action=history"/>
	<updated>2026-05-22T07:19:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;diff=6046&amp;oldid=prev</id>
		<title>Move page script: Move page script moved page SecureHandlers to WoW:SecureHandlers without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;diff=6046&amp;oldid=prev"/>
		<updated>2023-08-15T04:48:56Z</updated>

		<summary type="html">&lt;p&gt;Move page script moved page &lt;a href=&quot;/wiki/WoW:SecureHandlers&quot; title=&quot;WoW:SecureHandlers&quot;&gt;SecureHandlers&lt;/a&gt; to &lt;a href=&quot;/wiki/WoW:SecureHandlers&quot; title=&quot;WoW:SecureHandlers&quot;&gt;SecureHandlers&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:48, 15 August 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Move page script</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;diff=6044&amp;oldid=prev</id>
		<title>Bear at 00:20, 18 May 2020</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;diff=6044&amp;oldid=prev"/>
		<updated>2020-05-18T00:20:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:20, 18 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Uitech}} &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- This sucks; this is both framexml and technical details, and probably needs its own nav type. --&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Uitech}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;SecureHandlers&amp;#039;&amp;#039;&amp;#039; is a new set of widget templates provided in [[Patch 3.0]] to enhance addon functionality while in combat lockdown, replacing most variations of SecureStateHeader behavior in 2.0. The templates enable execution of a limited subset of addon code in a restricted but secure environment, allowing addons to perform actions that would normally be impossible.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;SecureHandlers&amp;#039;&amp;#039;&amp;#039; is a new set of widget templates provided in [[Patch 3.0]] to enhance addon functionality while in combat lockdown, replacing most variations of SecureStateHeader behavior in 2.0. The templates enable execution of a limited subset of addon code in a restricted but secure environment, allowing addons to perform actions that would normally be impossible.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bear</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;diff=6045&amp;oldid=prev</id>
		<title>WoWWiki&gt;Starlightblunder: New page: {{Uitech}} &lt;!-- This sucks; this is both framexml and technical details, and probably needs its own nav type. --&gt; &#039;&#039;&#039;SecureHandlers&#039;&#039;&#039; is a new set of widget templates provided in [[Patch ...</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlers&amp;diff=6045&amp;oldid=prev"/>
		<updated>2009-04-04T23:03:25Z</updated>

		<summary type="html">&lt;p&gt;New page: {{Uitech}} &amp;lt;!-- This sucks; this is both framexml and technical details, and probably needs its own nav type. --&amp;gt; &amp;#039;&amp;#039;&amp;#039;SecureHandlers&amp;#039;&amp;#039;&amp;#039; is a new set of widget templates provided in [[Patch ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Uitech}} &amp;lt;!-- This sucks; this is both framexml and technical details, and probably needs its own nav type. --&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SecureHandlers&amp;#039;&amp;#039;&amp;#039; is a new set of widget templates provided in [[Patch 3.0]] to enhance addon functionality while in combat lockdown, replacing most variations of SecureStateHeader behavior in 2.0. The templates enable execution of a limited subset of addon code in a restricted but secure environment, allowing addons to perform actions that would normally be impossible.&lt;br /&gt;
&lt;br /&gt;
SecureHandlers are implemented entirely in Lua/XML code, and code is publicly visible as part of [[FrameXML]]. The templates are defined in SecureHandlerTemplates.xml, supporting code is in SecureHandlers.lua, and the restricted environment/execution framework is provided by RestrictedExecution.lua, RestrictedFrames.lua, and RestrictedEnvironment.lua files.&lt;br /&gt;
&lt;br /&gt;
== SecureHandler templates==&lt;br /&gt;
{| class=&amp;quot;darktable&amp;quot;&lt;br /&gt;
! Template !! Function !! Executed snippets&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerBaseTemplate || Enables use of SecureHandler methods on the frame. || &amp;#039;&amp;#039;none&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerStateTemplate || Fires snippet when a state-&amp;#039;&amp;#039;xxx&amp;#039;&amp;#039; attribute changes. || &amp;#039;&amp;#039;&amp;#039;_onstate-&amp;#039;&amp;#039;xxx&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;(self, stateid, newstate)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerAttributeTemplate || Responds to attribute changes || &amp;#039;&amp;#039;&amp;#039;_onattributechanged&amp;#039;&amp;#039;&amp;#039;(self, name, value)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerClickTemplate || Responds to clicks || &amp;#039;&amp;#039;&amp;#039;_onclick&amp;#039;&amp;#039;&amp;#039;(self, button, down)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerDoubleClickTemplate || Responds to double clicks || &amp;#039;&amp;#039;&amp;#039;_ondoubleclick&amp;#039;&amp;#039;&amp;#039;(self, button, down)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerDragTemplate || Enables dragging || &amp;#039;&amp;#039;&amp;#039;_ondragstart&amp;#039;&amp;#039;&amp;#039;(self, button), &amp;#039;&amp;#039;&amp;#039;_onreceivedrag&amp;#039;&amp;#039;&amp;#039;(self, button, kind, value, ...)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerMouseUpDownTemplate || Mouse up/down events || &amp;#039;&amp;#039;&amp;#039;_onmouseup&amp;#039;&amp;#039;&amp;#039;(self, button), &amp;#039;&amp;#039;&amp;#039;_onmousedown&amp;#039;&amp;#039;&amp;#039;(self, button)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerMouseWheelTemplate || Mouse wheel || &amp;#039;&amp;#039;&amp;#039;_onmousewheel&amp;#039;&amp;#039;&amp;#039;(self, delta)&lt;br /&gt;
|-&lt;br /&gt;
| SecureHandlerEnterLeaveTemplate || Mouse entering/leaving frame || &amp;#039;&amp;#039;&amp;#039;_onenter&amp;#039;&amp;#039;&amp;#039;(self), &amp;#039;&amp;#039;&amp;#039;_onleave&amp;#039;&amp;#039;&amp;#039;(self)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Snippets ==&lt;br /&gt;
To add a snippet for a SecureHandler template to call, you should set it as an attribute on the widget inheriting from a SecureHandler template. For example:&lt;br /&gt;
 -- Assume widget is a frame inheriting from SecureHandlerClickTemplate.&lt;br /&gt;
 widget:SetAttribute(&amp;quot;_onclick&amp;quot;, [=[ -- self, button, down are considered &amp;quot;arguments&amp;quot; to the _onclick handler&lt;br /&gt;
  if button == &amp;quot;RightButton&amp;quot; then&lt;br /&gt;
   self:Hide();&lt;br /&gt;
  end&lt;br /&gt;
 ]=]);&lt;br /&gt;
The &amp;lt;code&amp;gt;[=[ ... ]=]&amp;lt;/code&amp;gt; syntax allows you to specify long strings without escaping characters within them.&lt;br /&gt;
&lt;br /&gt;
Snippets can access a limited subset of the World of Warcraft API; they are said to execute in a [[RestrictedEnvironment|restricted environment]]. Limitations include inability to handle native Lua tables (instead resorting to [[RestrictedEnvironment#Restricted tables|restricted tables]] and [[RestrictedEnvironment#Frame handle methods|frame references]]), and lack of direct access to functions (although some [[RestrictedEnvironment#Control methods|control methods]] can be used to emulate a call stack).&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
If &amp;#039;&amp;#039;widget&amp;#039;&amp;#039; inherits from a SecureHandler template, you can use the following methods:&lt;br /&gt;
; widget&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;Execute(&amp;quot;codeSnippet&amp;quot;) : executes codeSnippet in the [[RestrictedEnvironment|restricted environment]] owned by the widget.&lt;br /&gt;
; widget&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;WrapScript(frame, &amp;quot;script&amp;quot;, &amp;quot;preBody&amp;quot;, &amp;quot;postBody&amp;quot;) : wraps the specified script handler of an explicitly protected frame with the specified pre and post snippets. The snippets are executed within the widget&amp;#039;s restricted environment.&lt;br /&gt;
; widget&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;UnwrapScript(frame, &amp;quot;script&amp;quot;) : returns the outermost wrapped handler for the frame&amp;#039;s script handler.&lt;br /&gt;
; widget&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;SetFrameRef(&amp;quot;id&amp;quot;, frame) : creates a frame reference that can be accessed inside the restricted environment.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{elink|link=http://forums.worldofwarcraft.com/thread.html?topicId=11162847431&amp;amp;sid=1|icon=externalarticle|site=Introduction to the SecureHandlers|desc=by alestane.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{API Trail Secure}}&lt;/div&gt;</summary>
		<author><name>WoWWiki&gt;Starlightblunder</name></author>
	</entry>
</feed>