Coder Social home page Coder Social logo

kutepoyzon / tab-image-saver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mcdamo/tab-image-saver

1.0 0.0 0.0 1.04 MB

Firefox addon to save images from open tabs

Home Page: https://addons.mozilla.org/firefox/addon/tab-image-saver/

License: Mozilla Public License 2.0

JavaScript 96.41% CSS 3.28% HTML 0.31%

tab-image-saver's Introduction

tab-image-saver Addon Version Build Status

Tab Image Saver is a Firefox addon that makes it easy to save images from browser tabs you have open.

Download from Firefox Addons.

Features

By default this addon saves the largest image found on the active tab.

You may control how this functions by changing the addon preferences at in Firefox > Add-ons > Extensions > Tab Image Saver > Preferences or right-click the toolbar icon.

  • Multitasking Support - run addon concurrently in separate windows
  • Keyboard shortcut option
  • Run from active tab, tabs to the left/right of current tab, or all tabs.
  • Cancel running operation (click addon icon)
  • Set minimum image size in pixels
  • Option to only save tabs with images, ignoring tabs with webpages
  • Filenames renamed automatically
  • Display badge on icon with runtime information and count of downloads
  • Close tabs after saving
  • Hide saved images from download history
  • Show notification when complete

Path rules

Path rules are a flexible method for choosing the download filenames.

Rules can contain any combination of text strings and keywords.

Rules are processed top-down, if the rule does not evaluate to a valid path then it will proceed to the next rule in the list.

Keywords

  • Keywords are enclosed by angled brackets < >
  • They can use simple OR logic with the pipe symbol |
  • Keywords prepended with hashes # will be zero-padded

Example source: <img src="http://example.com/path/to/filename.jpg" alt="Caption">

Keyword Description Example
alt image's alt content Caption
name image's url filename without extension filename
xName image's filename from Content-Disposition header filename
ext image's url extension jpg
xExt image's extension from Content-Disposition header jpg
xMimeExt image's extension from Content-Type header jpg
host image's url hostname example.com
path image's url path path/to
index image number starting at '1', incremented for each image 1
tabTitle tab's page title (JPEG Image, 500 x 500 pixels)
tabHost tab's url hostname example.com
tabPath tab's url path path/to
tabFile tab's url filename without extension filename
tabExt tab's url extension jpg

Any tag not defined above will be treated as static text. For example <undef>.jpg will output undef.jpg

Examples

<name>.<ext|xExt|xMimeExt|jpg>

This will attempt to find the filename extension from the URL, Content-Disposition header, Content-Type header, and finally if all else fails will use jpg

img_<####index>.jpg

This will use the index of the image in the active download session. The index is incremented for each image saved and processed in tab order. The output will be zero padded, such as img_0001.jpg

Expressions

Expressions are an experimental extension to path rules to support string manipulation.

Currently implemented is replace using regular expresions.

Expressions are surrounded by double quotes " and must immediately follow after a keyword or path rule.

Syntax of an expression:

<alt>"/replace/regexp/newSubstr/flags"
      |   |       |       |       +- optional flags to RegExp
      |   |       |       +- replacement string or pattern
      |   |       +- search string or pattern
      |   +- 'replace' expression name. other expressions may be supported in future.
      +- delimiter

Any character may be selected as the delimiter as long as that character is not used anywhere within the expression patterns. The above example uses slash /, though if your expression patterns or strings contain slashes then you should select another symbol as the delimiter.

Examples

If alt contains a pipe symbol | then strip it and any trailing characters: <alt>"/replace/\s*\|.*/"

Rulesets

Rulesets can apply rules and options to a specific domain or url of the tab page.

Rulesets are tested in order from top to bottom. Any pages that are unmatched by a Ruleset will default to the Global settings.

The standard form of domain rule allows for simple wildcard matching (*).

Domain rules can also be interpreted as a regular expression by wrapping in hash characters (#).

Examples

The following examples are for https://example.com/page.html

Domain rule Match
example.com/ Yes
example.co Yes
example.co/ No
ample.com/ Yes
e*e.com/ Yes
/page.html Yes
#//example.[^/]{3}/# Yes

Acknowledgements

Libraries:

Graphics:

tab-image-saver's People

Contributors

dekosanjo avatar mcdamo avatar tducasse avatar yfdyh000 avatar zultron avatar

Stargazers

 avatar

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.