Drafts Action Directory

Convert Mobile Links to Desktop

Posted by @DavidAns, Last update about 1 month 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

Install

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

Comments

Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.