Greasy Fork is available in English.

Furaffinity-Custom-Pages

Library to create Custom pages on Furaffinitiy

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/476762/1549463/Furaffinity-Custom-Pages.js


作者
Midori Tsume
版本
1.2.2
创建于
2023-10-05
更新于
2025-03-07
大小
4.8 KB
许可证
MIT

Furaffinity Custom Pages

Helper Script to create Custom pages on Furaffinitiy. Also see docs on Furaffinity-Custom-Pages

How to use

  • @require this script

  • Create a new CustomPage:

    const customPage = new FACustomPage("pageUrl", "parameterName");
    

    See CustomPage for more info

  • Subscribe to the onOpen Event (Either directly or with addEventListener):

    customPage.onopen = (event) => { console.log(event.detail.parameterValue) };
    customPage.addEventListener("onOpen", (event) => { console.log(event.detail.parameterValue) });
    

    event.detail is the CustomData class

  • Trigger the check for open pages:

    FACustomPages.checkAllPages();
    

    See CustomPage for more info

Feature Roadmap

Feature Status
Have basic Custom Pages ✅ Completed
Support for url encoded parameters ⠀⠀⠀⠀ ✅ Completed

Documentation

CustomPage

The CustomPage class contains following Properties:

  • pageUrl - The url on which the parameter has to be to execute the event
  • parameterName - The name of the parameter on which you want the event to execute
  • parameterValue - The value of the parameter, if the CustomPage is open
  • isOpen - A boolean wether the CustomPage is open

It supports the following Events:

It has following functions:

  • pageOpened(parameterValue, openedPage) - Triggers the onopen event. Takes the current parameterValue and the openedPage HTML Document
  • checkPageOpened() - Checks if the CustomPage is open and triggers the event if it is

CustomData

The CustomData class contains following Properties:

  • parameterName - The parameterName of the current opened Page
  • parameterValue - The parameterValue of the current opened Page
  • document - The HTML Document of the current opened Page

It has following functions:

  • removeDocumentSiteContent() - Removes the default SiteContent of the openedPage document. Returns the document without SiteContent