<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rage.mp/w/index.php?action=history&amp;feed=atom&amp;title=Browser%3A%3AnewHeadless</id>
	<title>Browser::newHeadless - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rage.mp/w/index.php?action=history&amp;feed=atom&amp;title=Browser%3A%3AnewHeadless"/>
	<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Browser::newHeadless&amp;action=history"/>
	<updated>2026-06-05T00:27:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Browser::newHeadless&amp;diff=25469&amp;oldid=prev</id>
		<title>Shr0x: Created page with &quot;{{ClientsideJsFunction}} {{JSContainer| With headless browser, you can create anything in HTML and use it in game as game texture, for example applying its texture to a object or drawing it as a sprite.  ===Required Params=== *&#039;&#039;&#039;url:&#039;&#039;&#039; {{RageType|string}} *&#039;&#039;&#039;width:&#039;&#039;&#039; {{RageType|number}} *&#039;&#039;&#039;height:&#039;&#039;&#039; {{RageType|number}} *&#039;&#039;&#039;forceFlip:&#039;&#039;&#039; {{RageType|boolean}}  ===Return value=== *&#039;&#039;&#039; {{RageType|Object}} &#039;&#039;&#039;  ==Syntax== &lt;syntaxhighlight lang=&quot;javascript&quot;&gt; mp.browsers....&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Browser::newHeadless&amp;diff=25469&amp;oldid=prev"/>
		<updated>2024-05-24T17:46:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{ClientsideJsFunction}} {{JSContainer| With headless browser, you can create anything in HTML and use it in game as game texture, for example applying its texture to a object or drawing it as a sprite.  ===Required Params=== *&amp;#039;&amp;#039;&amp;#039;url:&amp;#039;&amp;#039;&amp;#039; {{RageType|string}} *&amp;#039;&amp;#039;&amp;#039;width:&amp;#039;&amp;#039;&amp;#039; {{RageType|number}} *&amp;#039;&amp;#039;&amp;#039;height:&amp;#039;&amp;#039;&amp;#039; {{RageType|number}} *&amp;#039;&amp;#039;&amp;#039;forceFlip:&amp;#039;&amp;#039;&amp;#039; {{RageType|boolean}}  ===Return value=== *&amp;#039;&amp;#039;&amp;#039; {{RageType|Object}} &amp;#039;&amp;#039;&amp;#039;  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; mp.browsers....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{ClientsideJsFunction}}&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
With headless browser, you can create anything in HTML and use it in game as game texture, for example applying its texture to a object or drawing it as a sprite.&lt;br /&gt;
&lt;br /&gt;
===Required Params===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;url:&amp;#039;&amp;#039;&amp;#039; {{RageType|string}}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;width:&amp;#039;&amp;#039;&amp;#039; {{RageType|number}}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;height:&amp;#039;&amp;#039;&amp;#039; {{RageType|number}}&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;forceFlip:&amp;#039;&amp;#039;&amp;#039; {{RageType|boolean}}&lt;br /&gt;
&lt;br /&gt;
===Return value===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039; {{RageType|Object}} &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
mp.browsers.newHeadless(url, width, height, forceFlip);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
const browser = mp.browsers.newHeadless(&amp;quot;http://package/page/index.html&amp;quot;, 1920, 1080, false);&lt;br /&gt;
&lt;br /&gt;
mp.events.add(&amp;#039;render&amp;#039;, () =&amp;gt; {&lt;br /&gt;
    if (browser &amp;amp;&amp;amp; mp.browsers.exists(browser)) {&lt;br /&gt;
        mp.game.graphics.drawSprite(browser.headlessTextureDict, browser.headlessTextureName, 0.5, 0.5, 0.1, 0.1, 0, 255, 255, 255, 100, true);&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
==See also==&lt;br /&gt;
{{Browser_definition_c}}&lt;br /&gt;
[[Category:Clientside API]]&lt;/div&gt;</summary>
		<author><name>Shr0x</name></author>
	</entry>
</feed>