开发者

Debugging with KBX extension : how to avoid having to deploy at every code modification?

开发者 https://www.devze.com 2023-02-26 19:58 出处:网络
I am currently debugging my apps so they can run with the KBX extension. KBX extension runs the last deployed version so everytime I change some code in the appbuild开发者_JAVA百科er I need to redeplo

I am currently debugging my apps so they can run with the KBX extension. KBX extension runs the last deployed version so everytime I change some code in the appbuild开发者_JAVA百科er I need to redeploy to see the changes. Could the Kynetx team give us a modified KBX extension that uses the last saved version instead?


We do have plans to make the KBX more developer friendly, but in the meantime, there are a few tricks.

We recommend spending most of your development time testing with bookmarklets, as these give you greater control over when your actions fire, allowing easier inspection between the state of the page before and after your rules fire. Applications can be tested with bookmarklets with no change to the code, and are easy to use.

This does not help debugging in the rare case that your application behaves differently while running in the KBX, but it should get you past most troubles you are currently experiencing.


Here is a solution for Chrome and Firefox: a modified KBX extension that targets the latest version of apps: http://blog.lolo.asia/technology/kynetx/2011/04/16/debugging-with-kbx-extension-how-to-avoid-having-to-deploy-at-every-code-modification/

In short, I replaced :

KOBJ.add_config_and_run({‘rids’:response.apps});

with :

//patch run_latest_app_version_in_kbx
var run_latest_app_version_in_kbx= true;
var run_msg_json={‘rids’:response.apps};
if (run_latest_app_version_in_kbx===true){
    for (var i=0;i<response.apps.length;i++){
       run_msg_json[response.apps[i]+’:kynetx_app_version’]=’dev’;
    }
}
KOBJ.add_config_and_run(run_msg_json);
// 

in page_interaction/pages.js inside the Chrome extension and in resources/jid0-njkmo4quo4rc8p9kcuemahnyiku-kynetxforfirefox-data/page_interaction.js inside the Firefox extension

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号