[REL] In-Game Browser (For Modders) [DISCONTINUED]

Discussion in 'Mod Discussions' started by Raevn, August 23, 2013.

  1. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    This mod is a framework for other mods to use - by itself, it does not add anything, but allows other mods to easily display a webpage.

    An example using the Browser as a Bug Tracker viewer:
    Browser.png

    Installation
    Current build: 52168 (version 1)

    Step 1:
    Download the rBrowser.zip attachment, and extract it to <PA Install directory>/PA/media/ui/mods/

    Step 2:
    Install the PA UI Mod Manager: https://forums.uberent.com/threads/rel-ui-mod-manager-v1-2.50726/
    Tick the box for "In-Game Browser" to enable to mod.

    Usage
    Set "Requires=rBrowser" in your mod's ini file. The browser has a priority of 50, so it will load before other mods by default.

    You can then control the browser from your mod with the following functions:

    Open Browser
    model.openBrowser(); (or just "click: openBrowser" within a data-bind)
    Make sure you set a home page (and call navBrowserHome) before calling this method, or the browser won't display anything. OpenBrowser does not call navBrowserHome(), in order to allow you to close & reopen the browser at the same place.

    Close Browser
    model.closeBrowser(); (or just "click: closeBrowser" within a data-bind)

    Setting Brower Title
    model.browserTitle("Planetary Annihilation Bug Tracker");

    Setting Browser Home Page
    model.browserHome("http://pa.lennardf1989.com/Tracker/");

    Go to Home Page
    model.navBrowserHome();

    Attached Files:

    Last edited: September 7, 2013
    cola_colin and oxide246 like this.
  2. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    Awesome, I'll be using this. Thanks!
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I think this might be helpful when I'll tackly the todo point "redo chart integration" for PA Stats. Currently they are a bit scroll heavy.
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Continues to work in build 52512.
  5. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
  6. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Not sure if it's cookies or session data that aren't kept (or both). If I remember correctly, @LennardF1989 said that a login to the bug tracker should be valid as long as the session is still active even without cookies, so it looks like it's more to do with sessions. It affects the PA forums too :(

    I've asked a dev about this, and they said they were looking into it. I tried again with the latest build, but it hasn't been enabled/fixed. It may be a security issue or other tricky one which they can't simply turn on and leave it at that.
  7. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    The cookie is in the browser, the session is on the server. You can't hold a session without passing a session id for each request. The session id is usually stored in the cookie, but you could potentially pass it through the URL, or via page form posts or something. Having a cookie is definitely the most convenient method.

    I don't see how it would be any less secure than standard web browsing... A malicious mod could post the session cookie somewhere, but it can do stuff like that now anyway, I don't see how a cookie makes it worse. I think it's more likely they just hadn't considered it/didn't need it until you asked about it.
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Continues to work in 52973 (sessions issue is still present)
  9. masterdigital

    masterdigital Uber Alumni

    Messages:
    438
    Likes Received:
    833
    So I would like to just include this mod in the regular build. I will credit you in the files. I would as like to incorporate the bug tracker.

    If you agree, I will add browser.js/css to the code base. I have modified it slightly (and will modify it more in future as required to support feature requests).

    The browser would be loaded just before the mod list.
  10. ChillAAA

    ChillAAA Member

    Messages:
    57
    Likes Received:
    13
    Community awesomeness right here.
  11. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I certainly agree :)
  12. masterdigital

    masterdigital Uber Alumni

    Messages:
    438
    Likes Received:
    833
  13. cwarner7264

    cwarner7264 Moderator Alumni

    Messages:
    4,460
    Likes Received:
    5,390
    You posted this at about 3 in the morrning PDT. I presume the office camp bed is comfy?

    Also, 'grats Raevn on getting not one, but two mods included in the final game! (so far...)
  14. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    This is now included in the game under media\ui\alpha\shared\browser.js :)
    cwarner7264 likes this.
  15. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    I just came here to download this and it looks like I don't have to! AND cookies are working!! Happy days!

Share This Page