Code Monkey home page Code Monkey logo

Comments (6)

liminzhu avatar liminzhu commented on May 22, 2024

Hi @SrinivasGourarum. In general, we currently recommend using Chakra instead of ChakraCore for UWP apps. ChakraCore is the part of Chakra that has no ties with Windows, and as you saw some of the Windows related APIs are missing (winrt/uwp projection, debugging).

Specifically for debugging, our script debugging in Chakra (JsStartDebugging) is PDM-based, so that is not part of ChakraCore as well. However, we are actively working on a new set of debugging APIs in the JSRTDebugging branch. Note that this work is not finished yet and the API shape may change, so be cautious about taking dependencies. Do let us know your thoughts in case you've tried or plan to try the debugging APIs. The parse script as library work you experimented is part of the debugging effort.

Limin

from chakra-samples.

SrinivasGourarum avatar SrinivasGourarum commented on May 22, 2024

I am assuming that once ChakraCore is released, we can have this feature(parse script as library) with Chakra as well. Meanwhile, in order to make our js files hidden from the user while debugging using Chakra for UWP apps on windows 10, we could replace the content of the js file (which we intend to hide while debugging script) with the base64 string of the serialized byte[].

byte[] serializeBuffer = JsSerializeScript(originalContent, buff, buffsize);
string base64Str = Convert.ToBase64String(serializeBuffer);

This way we are able to hide the file from debugging. My question is if someone would be able to re-generate the original content of the file if they are able to access the base64Str? Do we need to have an additional encryption for the file?

We intend to use ChakraCore for older windows versions like windows phone 8.1 and windows 8.1. Having the capability to debug the script and other debugging apis for memory usage will definitely add on to the debugging experience.

from chakra-samples.

liminzhu avatar liminzhu commented on May 22, 2024

I am assuming that once ChakraCore is released, we can have this feature(parse script as library) with Chakra as well.

JsParseScriptWithAttributes is in ChakraCore master so you can use it now. For Chakra you might need to wait a little longer for it to be supported in UWP.

Meanwhile, in order to make our js files hidden from the user while debugging using Chakra for UWP apps on windows 10, we could replace the content of the js file (which we intend to hide while debugging script) with the base64 string of the serialized byte[].

byte[] serializeBuffer = JsSerializeScript(originalContent, buff, buffsize);
string base64Str = Convert.ToBase64String(serializeBuffer);

JsSerializeScript is not really designed as an encryption method. In fact, I believe if you Convert.FromBase64String(base64Str) to get the byte buffer and then call JsRunSerializedScript with the buffer, Chakra de-serialize and expose the original script to the debugger. So someone can still access the original script if he know what he's doing. JsParseScriptWithAttributes and JsParseScriptAttributeLibraryCode attribute will hide your code from debugger for you. However if you use Chakra in its current state you may need additional encryption.

We intend to use ChakraCore for older windows versions like windows phone 8.1 and windows 8.1. Having the capability to debug the script and other debugging apis for memory usage will definitely add on to the debugging experience.

I'm super glad to hear it! One of our purposes to open-source ChakraCore is to make it available for pre-Windows 10 OS as Chakra.dll is not there. As a quick status update for debugging, currently we have new debugging APIs in a PR against ChakraCore master. Profiling is something we don't have now but it's on our roadmap and we will definitely look into it.

from chakra-samples.

SrinivasGourarum avatar SrinivasGourarum commented on May 22, 2024

Thanks @liminzhu. We would continue to use Chakra for windows 10 as recommended.
I strongly urge you to bring in the api "JsParseScriptWithAttributes" to Chakra as early as possible.
This will be useful in hiding host js files from debugging.

Also, is there any tentative timeframe around which we can expect ChakraCore to be released so that we can start taking dependencies?

from chakra-samples.

liminzhu avatar liminzhu commented on May 22, 2024

Sorry for the late response @SrinivasGourarum.

Duly noted. we'll work on getting this API into Chakra and Windows. It probably will land in a Win10 insider preview build first, and then in the next windows release.

We are very close to finish release/1.2 for ChakraCore (maybe just in a few weeks). For now you can build from the release/1.2 branch, or use the preview bits from our myget feed.

from chakra-samples.

SrinivasGourarum avatar SrinivasGourarum commented on May 22, 2024

Thanks @liminzhu.
That's good to hear about ChakraCore. We will plan accordingly.

from chakra-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.