Skip to content

[Feature Rueqest] Force update for scripts under development #767

Closed
@momocow

Description

@momocow

Hi, I've created a Webpack plugin for developers to develop userscripts with powerful Webpack toolchains.

The plugin actually prepends the meta block to output scripts, and also generates the corresponding *.meta.js along with each script.

Developers can benefit from using the plugin along with webpack-dev-server to serve the output files in watch mode. Once modification on source files are saved, the output files are compiled. Also a build number can be appended to the version string to force the version increase.

To test the scripts, an URL pointed to the output of the webpack-dev-server can be used to install the script to TM. However, after every change of source files, developers should manually click the update button provided by TM to update the script.

By default, the dev-server will reload/refresh the page when file changes are detected.

As described in the webpack doc, devServer.liveReload configuration, the webpack-dev-server is able to reload the page on sources changed, the problem is that TM does not get informed about the change thus there is no update to the script.

I'm asking if there is a way to force TM update the script when page reload (which means sources changed), the feature can be enabled only if you know you're developing on specific script, to avoid annoying normal users. (or is there any existing solution to make the dev flow works?)

Any feedback is appreciated, thanks!

Activity

derjanb

derjanb commented on Oct 16, 2019

@derjanb
Member

Simply copy your script header to Tampermonkey, then @require the real script as external resource and enabled "Advanced" "Config Mode" to be able to set "Externals" > "Update Interval" to "Always"

ghost
Kane-Kuroneko

Kane-Kuroneko commented on Nov 4, 2024

@Kane-Kuroneko

On a related note to this issue, would it be possible to fix the external resource refresh mechanism.

If I have a webpack devServer running, I have my development script proxied as an external request and I have Update Interval -> Always set as an option.... the devServer will trigger a page refresh in my browser when the script changes, but I'll still have to manually refresh my browser 2 or 3 times before the new script kicks in.

please reopen this , issue still exsist yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      [Feature Rueqest] Force update for scripts under development · Issue #767 · Tampermonkey/tampermonkey