Giter VIP home page Giter VIP logo

upload-to-danbooru's Introduction

Upload to Danbooru Web Extension

Add a page action and a context menu option (for images) to upload to cardboard box Danbooru. Replacement for bookmarklets.

Install

Usage

Page Action

Page action demo

Just visit any Danbooru-supported page, then click cardboard box icon in the address bar.

Context Menu

Context menu demo

Right click on any image, select "Upload to Danbooru".

Build

npm i
npm run build       # Firefox
npm run buildChrome # Chrome

Extension package will be located in web-ext-artifacts/ folder.

Run Tests

npm test

Install In Developer Mode

Firefox

  • Open about:debugging#/runtime/this-firefox
  • Click Load Temporary Add-on
  • Select src/manifest.json file

Chrome

Make sure you have built extension.

  • Open Chrome Settings
  • Select Extensions
  • Enable developer mode
  • Click Load Unpacked
  • Select dist/ folder

web-ext

Firefox (sandbox):

npx web-ext run

Android:

npx web-ext run --firefox-apk org.mozilla.fenix --target=firefox-android --android-device=DEVICE_ID

Replace DEVICE_ID with id of the device from adb devices.

upload-to-danbooru's People

Contributors

hdk5 avatar namelesscontributor avatar zipfile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

upload-to-danbooru's Issues

Show addressbar icon on more urls

feature request: Improve fantia upload support

There are at least three types of media that can be attached to fantia post.
Related: danbooru/danbooru#5580

For all three cases below, ideal behavior would be - both direct image url, and page address ref (or url that can be converted into one by danbooru), are present

1. post_content_photo - somewhat working

For example, https://fantia.jp/posts/2302310
Each image has to be open individually.

On https://fantia.jp/posts/*/post_content_photo/* page:

  • icon appears in address bar;
  • by clicking on the icon, only this page url without direct image url is sent to /uploads/new - danbooru can't extract the image;
  • by using the context menu item, direct image url, as well as this page as ref, are sent to /uploads/new - danbooru can extract both the image and page address (assuming PR above is merged)

If I "Open Image in New Tab", on https://cc.fantia.jp/uploads/post_content_photo/file/* page:

  • icon does not appear in address bar;
  • by using the context menu item, direct image url is sent both as url and ref - danbooru can extract the image, but not the page address

2. album_image - not working

For example, https://fantia.jp/posts/2293136
Each image has to be open individually.

Clicking on the image opens https://fantia.jp/posts/*/album_image?query=* page, which redirects to https://cc.fantia.jp/uploads/album_image/file/*/* page. Here:

  • icon does not appear in address bar;
  • by using the context menu item, the original redirect page url is sent to /uploads/new as url - danbooru can't extract the image;
  • direct image url can still be copied to upload form manually;

3. download / post_content/file - not working

For example, https://fantia.jp/posts/61560
Similar to album_image, but context menu item does not appear on mp4 video

Add extension to context menu when right-clicking links

Just to name one use case, when browsing a Twitter timeline, it is currently not possible to just right-click a tweet link to upload that entire tweet. Instead, one has to open the tweet into a new tab, which takes around 15-30 seconds on average to load, and then execute the extension there.

Wrong image source when uploading from Pixiv

Describe the bug

When uploading images from Pixiv using the extension, it sometimes uploads images using a direct link (https://i.pximg.net) instead of the general one (https://www.pixiv.net).

To Reproduce

Steps to reproduce the behavior:

  1. Go to Pixiv
  2. Select any artwork
  3. Click the icon on the search bar / Click "Upload to Danbooru" from the context menu
  4. Check source

Additional info:

  • Browser: Firefox Developer Edition 119.0b9
  • Extension ver: 3.3.1
  • This issue is really inconsistent - sometimes it's every other time, sometimes it's all the time, and sometimes everything works fine until you completely forget about the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.