JavaScript template library that doesn't use eval/new Function

前端 未结 10 1238
抹茶落季
抹茶落季 2021-02-05 17:52

Google Chrome extensions using manifest_version: 2 are restricted from using eval or new Function. All of the JavaScript templating librar

10条回答
  •  一个人的身影
    2021-02-05 18:37

    Maybe you can write a function eval1:

    function eval1(blah) {
        var s = document.createElement("script");
        s.src = blah;
        document.head.appendChild(s);
        document.head.removeChild(s);
    }
    

    and do a find/replace in the library you want, but that'd be cheating, right?

提交回复
热议问题