Reputation: 1411
I'm trying to get this code to render in a packaged app however if I go into sandbox mode, the chrome local storage doesn't work, so I'm thinking about how to rewrite this piece of javascript with out using eval.
if (eval(conditions.join(' && '))) {
created = $.DOMCached.get("created", namespace);
started[namespace] = $.DOMCached.get("started", namespace);
jTask.timer[namespace] = $.DOMCached.get("timer", namespace);
p += '<p class="jtrack-item' + (archived ? ' jtrack-archived' : '') + (completed ? ' jtrack-completed' : '') + '">' + created + '<label>' + namespace + '</label><a href="#" class="jtrack-update entypo-cog" rel="' + namespace + '"></a> | <a href="#" class="jtrack-remove entypo-trash" rel="' + namespace + '"></a><span class="jtrack-timer">' + this.hms(jTask.timer[namespace]) + '</span><a href="#" class="jtrack-power entypo-back-in-time' + (started[namespace] ? ' jtrack-power-on' : '') + '" title="Timer on/off" rel="' + namespace + '"></a></p>';
if (started[namespace]) {
this.timerScheduler(namespace);
}
}
Upvotes: 1
Views: 57
Reputation: 1411
I rewrote it to look like this..
if (conditions && conditions.join(' && ')) {
after reading through the doc here..
https://developer.chrome.com/extensions/contentSecurityPolicy
Upvotes: 1