diff --git a/web/client/components/app/withExtensions.js b/web/client/components/app/withExtensions.js index 849ea58581..9b086825e3 100644 --- a/web/client/components/app/withExtensions.js +++ b/web/client/components/app/withExtensions.js @@ -137,7 +137,7 @@ function withExtensions(AppComponent) { castArray(translationsPath).filter(p => p !== this.getAssetPath(translations))); } // remove the script element associated with the plugin, if it exists - const script = document.querySelector(`script[src="${this.getAssetPath(plugin)}/index.js"]`); + const script = document.querySelector(`script[src^="${this.getAssetPath(plugin)}/index.js"]`); script && script.remove(); }; diff --git a/web/client/utils/PluginsUtils.js b/web/client/utils/PluginsUtils.js index 5059a61fc5..e4c2fc0947 100644 --- a/web/client/utils/PluginsUtils.js +++ b/web/client/utils/PluginsUtils.js @@ -15,6 +15,7 @@ import curry from 'lodash/curry'; import {combineEpics as originalCombineEpics} from 'redux-observable'; import {combineReducers as originalCombineReducers} from 'redux'; import {wrapEpics} from "./EpicsUtils"; +import { randomInt } from './RandomUtils'; /** * Loads a script inside the current page. @@ -25,7 +26,7 @@ function loadScript(src) { const s = document.createElement('script'); let r = false; s.type = 'text/javascript'; - s.src = src; + s.src = src + "?v=" + randomInt(); s.async = true; s.onerror = function(err) { reject(err, s);