ProWritingAid Premium Unlocker

Unlocks ProWritingAid Premium so that you don't have to pay.

当前为 2025-02-22 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         ProWritingAid Premium Unlocker
// @namespace    prowritingaid.taozhiyu.gitee.io
// @version      0.3.1
// @description  Unlocks ProWritingAid Premium so that you don't have to pay.
// @author       longkidkoolstar
// @match        https://prowritingaid.com/*
// @icon         https://prowritingaid.com/favicon.ico
// @require      https://greasyfork.org/scripts/455943-ajaxhooker/code/ajaxHooker.js?version=1124435
// @run-at       document-start
// @grant        none
// @license      none
// ==/UserScript==
/* global ajaxHooker */
(function() {
    'use strict';

    // Hooking AJAX request to unlock premium
    ajaxHooker.hook(request => {
        if (request.url.endsWith('api/user/status') || request.url.endsWith('api/subscription')) {
            request.response = res => {
                const json = JSON.parse(res.responseText);
                const a = "data" in json ? json.data : json;
                a.isPremium = true;
                a.subscriptionEnd = '2099-12-31T23:59:59Z'; // Never expires
                a.features = ['advanced-grammar', 'style-suggestions', 'reports', 'all', 'ai-sparks', 'critique-report'];
                a.userTier = 'premium-pro';
                res.responseText = JSON.stringify("data" in json ? (json.data = a, json) : a);
            };
        }
    });

    // Create and display the popup
    window.addEventListener('load', () => {
        const popup = document.createElement('div');
        popup.style.position = 'fixed';
        popup.style.bottom = '20px';
        popup.style.right = '20px';
        popup.style.padding = '15px';
        popup.style.backgroundColor = '#f9f9f9';
        popup.style.boxShadow = '0px 4px 6px rgba(0, 0, 0, 0.1)';
        popup.style.border = '1px solid #ccc';
        popup.style.borderRadius = '8px';
        popup.style.zIndex = '10000';
        popup.style.fontFamily = 'Arial, sans-serif';
        popup.style.color = '#333';
        popup.style.textAlign = 'center';

        const message = document.createElement('p');
        message.textContent = 'Join our Discord community for a WORKING SCRIPT with CONTINUOUS UPDATES and more features which now unlocks everything in ProWritingAid, not only Premium tools!';
        message.style.margin = '0 0 10px';

        const link = document.createElement('a');
        link.href = 'https://discord.gg/ProWritingAidUnlockers';
        link.textContent = 'Join Discord';
        link.style.color = '#007bff';
        link.style.textDecoration = 'none';
        link.style.fontWeight = 'bold';
        link.target = '_blank';

        link.addEventListener('mouseover', () => link.style.textDecoration = 'underline');
        link.addEventListener('mouseout', () => link.style.textDecoration = 'none');

        popup.appendChild(message);
        popup.appendChild(link);

        const closeButton = document.createElement('button');
        closeButton.textContent = '✖';
        closeButton.style.position = 'absolute';
        closeButton.style.top = '5px';
        closeButton.style.right = '5px';
        closeButton.style.background = 'none';
        closeButton.style.border = 'none';
        closeButton.style.cursor = 'pointer';
        closeButton.style.fontSize = '16px';
        closeButton.style.color = '#333';

        closeButton.addEventListener('click', () => {
            document.body.removeChild(popup);
        });

        popup.appendChild(closeButton);

        document.body.appendChild(popup);
    });

})();