Return value missed within the closure after browserified

风格不统一 提交于 2019-12-13 01:24:37

问题


My original script looks like this:

(function() {
    // result = doSomeWorks()
    return result;
})();

Which I can get a return value from APIs like chrome.tabs.executeScript or execute_script of selenium/webdriver.

But after the script being browserified (http://pastebin.com/7dBJuGzL), the return value seems just missed. I always get a null value from the above APIs.

Is there any solution/workaround for this? Or maybe trying to get the return value from a browserified script it just not idiomatic to Browserify?

Thanks in advance.

来源:https://stackoverflow.com/questions/34540906/return-value-missed-within-the-closure-after-browserified

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!