You need to know on which pages that plugin is loaded, so that you will not load it from your module, or overwrite your scripts variable in the hook_preprocess_page() function and check there if the plugin is already loaded. Another way would be to get the already loaded js when you add you plugin and check if the other module loaded it already (in this case you have to be sure that the other module adds the js before you do the check!). You can do that with drupal_add_js(NULL, NULL, NULL). This will return you the array with the js files that were added.
Comments
Hi, You need to know on
Hi,
You need to know on which pages that plugin is loaded, so that you will not load it from your module, or overwrite your scripts variable in the hook_preprocess_page() function and check there if the plugin is already loaded. Another way would be to get the already loaded js when you add you plugin and check if the other module loaded it already (in this case you have to be sure that the other module adds the js before you do the check!). You can do that with drupal_add_js(NULL, NULL, NULL). This will return you the array with the js files that were added.
Regards,
Vasi.
You can do that with
That's a nice little trick.
Contact me to contract me for D7 -> D10/11 migrations.