How to make plugin domain specific?

0 favourites
  • 5 posts
From the Asset Store
Domain/site obfuscation, very simple implementation
  • I wrote a plugin that I've been using for my own purposes so far, and it's working fine, but there are still a few bugs/annoyances I want to fix before I release it to Construct's general plugin pool.

    One of these bugs is that it breaks Construct in debug mode.

    This is because the plugin requires the application to run in a specific domain (in this case Synaptop) to run any of the plugin's functionality, similar to Kongregate.

    However, Kongregate's plugin and Facebook's plugin simply do not run in the Construct 2's debugger, my plugin actually breaks the debugger. (When exported and run in the wrong domain it simply doesn't run, similar to the other plugins, when exported and run on Synaptop, it works as it should.)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's probably just a mistake in your plugin. Nobody can help without more information about the error though.

  • And that's what I'm trying to fix, I can give more information.

    The error is as follows:

    Javascript error!

    ReferenceError: synaptop is not defined

    localhost/Synaptop_plugin.js, line 67 (col undefined)

    This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer!

    Line 67 of the run time file is where I call the actual code which loads the api.

    Furthermore, the plugin requires a modification of the html header file exported by Construct 2 (it takes in and finds the app ID). It may well be not having this piece which causes the error during debugging.

  • I guess what I'm looking for is if there's an easy way to turn off a plugin during debugging mode, as implemented on the side of the plugin developer.

  • when you load the api, check if synaptop is undefined. If it isn't, don't load it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)