No announcement yet.

[CLOSED] [#809] Prepend output with comment

  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#809] Prepend output with comment


    I'm trying to prepend the output of the code (the code is using "combineScripts": true) with a comment.

    This is what needs to be on top of the code:

    // ==UserScript==
    // @name        --
    // @author      --
    // @namespace   --
    // @description --
    // @include     --
    // @version     0.01
    // @downloadURL --
    // @grant       GM_addStyle
    // @grant       GM_xmlhttpRequest
    // @grant       GM_getValue
    // @grant       GM_setValue
    // @grant       GM_log
    // @grant       GM_info
    // @require
    // @require
    // ==/UserScript==

    How can I do so with Visual Studio, or does the JSON have an option for this?


    At the moment this functionality is not supported within Bridge.NET, but with the upcoming v1.11 release, we will be adding functionality to the [Init] Attribute to enable. More info on the [Init] Attribute is available in the Knowledge Base Attribute Reference.

    For example, the following sample demonstrates how this new Enum value will be configured in .cs, and then below demonstrates the proposed compiled .js.

    Example (.cs)

    public class App
        public static void Top()
            // Your comment and code
            Console.Log("Init Top");
    Example (.js)

    // Your comment and code
    console.log("Init Top");
    /* global Bridge */
    Any code or comments within the Method body will be rendered directly to the top of the compiled .js file, and will NOT be wrapped in a function closure. This will enable total flexibility in rendering content to the top of the file.

    There will also be an InitPosition.Bottom Enum value, which will render the Method body contents directly to the bottom of the file.

    The 1.11 Milestone status can be tracked at:

    To work-around this Bridge limitation right now, you could add the comments to another .js file, then combine the files through some bundling software, such as Gulp or Grunt.

    Hope this helps.
    Last edited by geoffrey.mcgill; 2016-03-15 @ 05:02 PM.


      Created an Issue: