Action

Convert Mobile Links to Desktop

Posted by @DavidAns, Last update about 6 years ago

Converts links for the mobile version of web sites into the corresponding desktop link.

Example: https://en.m.wikipedia.org/wiki/Cat -> https://en.wikipedia.org/wiki/Cat

Supported sites:
Wikipedia

Steps

  • script

    // Converts links for the mobile version of web sites into the corresponding desktop link
    const beforeText = editor.getText();
    const replacements = [
      [/(\/\/(?:[a-z]+\.)?)m\.(wikipedia\.org\/)/gi, "$1$2"]
    ];
    const afterText = replacements.reduce((acc, cur) => acc.replace(cur[0], cur[1]), beforeText);
    editor.setText(afterText);
    

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.