<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Opera Mini: resuming paused script (for analytics)]]></title><description><![CDATA[<p dir="auto">So I've been reading <a href="https://dev.opera.com/articles/opera-mini-and-javascript/" target="_blank" rel="noopener noreferrer nofollow ugc">Opera Mini and JavaScript</a> and I'm trying to figure out how to resume paused scripts.</p>
<p dir="auto">Essentially, I am trying to track a button using analytics (I'm using <a href="https://metrica.yandex.com/" target="_blank" rel="noopener noreferrer nofollow ugc">Yandex Metrica</a> to do so).</p>
<pre><code>  window.onload = function () {
      onClick = function () {
        var button = document.getElementById('button');

        setGoal = function () {
          ym(54060910, 'reachGoal', 'TEST');
          return true;
        }

        setInterval(setGoal, 50);

        // Unpauses the interval
        restart = function () {
          // This can be an empty function
        }
        button.addEventListener('click', restart, false);
      }
    }
</code></pre>
<p dir="auto">The tracking works fine in modern browsers, but not Opera Mini. I have modelled this function off the one in the above blog post, which is meant to resume paused scripts:</p>
<pre><code>var box = document.getElementById('box'),
	update = document.getElementById('valofnewcol'),
	start = 0;

changecolor = function(element, degreeshift, update) {
	var newcol = (start * degreeshift) / 360 &lt;&lt; 8,
	col = 'hsl(' + newcol + ', 100%, 50%)',
	coltxt = document.createTextNode(col),
	anim,
	restart;

	element.style.background = col;
	start++;

	if (update.firstChild) {
		update.replaceChild(coltxt, update.firstChild);
	} else {
		update.appendChild(coltxt);
	}
}

anim = setInterval(changecolor, 50, box, 45, update);

// Unpauses the interval
restart = function(){
	// This can be an empty function
}
box.addEventListener('click', restart, false);
</code></pre>
<p dir="auto">My questions are:</p>
<ul>
<li>Is it possible to get tracking for analytics working in Opera Mini using this method?</li>
<li>And if so, how do I amend my code to achieve that?</li>
</ul>
<p dir="auto">P.s I am using Yandex Metrica but I would assume the same principles would apply to Google Analytics.</p>
<p dir="auto">P.p.s I've asked <a href="https://stackoverflow.com/questions/57111137/opera-mini-resuming-paused-script-for-analytics" target="_blank" rel="noopener noreferrer nofollow ugc">the same question on Stackoverflow</a> if you'd like to answer there.</p>
]]></description><link>https://forums.opera.com/topic/33825/opera-mini-resuming-paused-script-for-analytics</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 18:37:05 GMT</lastBuildDate><atom:link href="https://forums.opera.com/topic/33825.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Jul 2019 14:00:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Opera Mini: resuming paused script (for analytics) on Wed, 24 Jul 2019 11:49:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">does anyone else have any ideas?</p>
<p dir="auto">What I'm simply trying to do is use Opera minis ability to <a href="https://dev.opera.com/articles/opera-mini-and-javascript/" target="_blank" rel="noopener noreferrer nofollow ugc">resume paused scripts</a> to be able to use analytics to track what our users are doing.</p>
<p dir="auto">Has anyone else came across this problem before and could share some advice?</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forums.opera.com/post/177024</link><guid isPermaLink="true">https://forums.opera.com/post/177024</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Wed, 24 Jul 2019 11:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to Opera Mini: resuming paused script (for analytics) on Mon, 22 Jul 2019 09:38:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forums.opera.com/uid/141472">@jackob11</a> So no matter what, there's no way to force a script to run unless the user goes to an address bar and enters javascript:skip? It has to be done by the user, not a script?</p>
]]></description><link>https://forums.opera.com/post/176832</link><guid isPermaLink="true">https://forums.opera.com/post/176832</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Mon, 22 Jul 2019 09:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to Opera Mini: resuming paused script (for analytics) on Fri, 19 Jul 2019 17:31:37 GMT]]></title><description><![CDATA[<p dir="auto">Sometimes &amp; even on some website<br />
javascript:skip works but not every website.<br />
When the javascript is paused then all you need to do is to go to address bar of that following page type javascript:skip then enter. On some website it will resume the paused javascript.<br />
I don't think there has any other way to resume it.</p>
]]></description><link>https://forums.opera.com/post/176622</link><guid isPermaLink="true">https://forums.opera.com/post/176622</guid><dc:creator><![CDATA[jackob11]]></dc:creator><pubDate>Fri, 19 Jul 2019 17:31:37 GMT</pubDate></item></channel></rss>