Skip to content

Commit 007a4d5

Browse files
authored
Merge pull request #2 from rtcoder/refactor
Refactor
2 parents bf732ea + ff3bf5c commit 007a4d5

27 files changed

+885
-596
lines changed

.editorconfig

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = crlf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = false
9+
max_line_length = 120
10+
tab_width = 2
11+
ij_continuation_indent_size = 4
12+
ij_formatter_off_tag = @formatter:off
13+
ij_formatter_on_tag = @formatter:on
14+
ij_formatter_tags_enabled = false
15+
ij_smart_tabs = false
16+
ij_visual_guides = none
17+
ij_wrap_on_typing = false
18+
19+
[*.less]
20+
ij_less_align_closing_brace_with_properties = false
21+
ij_less_blank_lines_around_nested_selector = 1
22+
ij_less_blank_lines_between_blocks = 1
23+
ij_less_brace_placement = 0
24+
ij_less_enforce_quotes_on_format = true
25+
ij_less_hex_color_long_format = false
26+
ij_less_hex_color_lower_case = false
27+
ij_less_hex_color_short_format = false
28+
ij_less_hex_color_upper_case = false
29+
ij_less_keep_blank_lines_in_code = 2
30+
ij_less_keep_indents_on_empty_lines = false
31+
ij_less_keep_single_line_blocks = false
32+
ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
33+
ij_less_space_after_colon = true
34+
ij_less_space_before_opening_brace = true
35+
ij_less_use_double_quotes = false
36+
ij_less_value_alignment = 0
37+
38+
[{*.cjs,*.js}]
39+
ij_javascript_align_imports = false
40+
ij_javascript_align_multiline_array_initializer_expression = false
41+
ij_javascript_align_multiline_binary_operation = false
42+
ij_javascript_align_multiline_chained_methods = false
43+
ij_javascript_align_multiline_extends_list = false
44+
ij_javascript_align_multiline_for = true
45+
ij_javascript_align_multiline_parameters = true
46+
ij_javascript_align_multiline_parameters_in_calls = false
47+
ij_javascript_align_multiline_ternary_operation = false
48+
ij_javascript_align_object_properties = 0
49+
ij_javascript_align_union_types = false
50+
ij_javascript_align_var_statements = 0
51+
ij_javascript_array_initializer_new_line_after_left_brace = false
52+
ij_javascript_array_initializer_right_brace_on_new_line = false
53+
ij_javascript_array_initializer_wrap = off
54+
ij_javascript_assignment_wrap = off
55+
ij_javascript_binary_operation_sign_on_next_line = false
56+
ij_javascript_binary_operation_wrap = off
57+
ij_javascript_blank_lines_after_imports = 1
58+
ij_javascript_blank_lines_around_class = 1
59+
ij_javascript_blank_lines_around_field = 0
60+
ij_javascript_blank_lines_around_function = 1
61+
ij_javascript_blank_lines_around_method = 1
62+
ij_javascript_block_brace_style = end_of_line
63+
ij_javascript_call_parameters_new_line_after_left_paren = false
64+
ij_javascript_call_parameters_right_paren_on_new_line = false
65+
ij_javascript_call_parameters_wrap = off
66+
ij_javascript_catch_on_new_line = false
67+
ij_javascript_chained_call_dot_on_new_line = true
68+
ij_javascript_class_brace_style = end_of_line
69+
ij_javascript_comma_on_new_line = false
70+
ij_javascript_do_while_brace_force = always
71+
ij_javascript_else_on_new_line = false
72+
ij_javascript_enforce_trailing_comma = keep
73+
ij_javascript_extends_keyword_wrap = off
74+
ij_javascript_extends_list_wrap = off
75+
ij_javascript_field_prefix = _
76+
ij_javascript_file_name_style = relaxed
77+
ij_javascript_finally_on_new_line = false
78+
ij_javascript_for_brace_force = always
79+
ij_javascript_for_statement_new_line_after_left_paren = false
80+
ij_javascript_for_statement_right_paren_on_new_line = false
81+
ij_javascript_for_statement_wrap = off
82+
ij_javascript_force_quote_style = true
83+
ij_javascript_force_semicolon_style = true
84+
ij_javascript_function_expression_brace_style = end_of_line
85+
ij_javascript_if_brace_force = always
86+
ij_javascript_import_merge_members = global
87+
ij_javascript_import_prefer_absolute_path = global
88+
ij_javascript_import_sort_members = true
89+
ij_javascript_import_sort_module_name = false
90+
ij_javascript_import_use_node_resolution = true
91+
ij_javascript_imports_wrap = on_every_item
92+
ij_javascript_indent_case_from_switch = true
93+
ij_javascript_indent_chained_calls = true
94+
ij_javascript_indent_package_children = 0
95+
ij_javascript_jsx_attribute_value = braces
96+
ij_javascript_keep_blank_lines_in_code = 2
97+
ij_javascript_keep_first_column_comment = true
98+
ij_javascript_keep_indents_on_empty_lines = false
99+
ij_javascript_keep_line_breaks = true
100+
ij_javascript_keep_simple_blocks_in_one_line = false
101+
ij_javascript_keep_simple_methods_in_one_line = false
102+
ij_javascript_line_comment_add_space = true
103+
ij_javascript_line_comment_at_first_column = false
104+
ij_javascript_method_brace_style = end_of_line
105+
ij_javascript_method_call_chain_wrap = off
106+
ij_javascript_method_parameters_new_line_after_left_paren = false
107+
ij_javascript_method_parameters_right_paren_on_new_line = false
108+
ij_javascript_method_parameters_wrap = off
109+
ij_javascript_object_literal_wrap = on_every_item
110+
ij_javascript_parentheses_expression_new_line_after_left_paren = false
111+
ij_javascript_parentheses_expression_right_paren_on_new_line = false
112+
ij_javascript_place_assignment_sign_on_next_line = false
113+
ij_javascript_prefer_as_type_cast = false
114+
ij_javascript_prefer_explicit_types_function_expression_returns = false
115+
ij_javascript_prefer_explicit_types_function_returns = false
116+
ij_javascript_prefer_explicit_types_vars_fields = false
117+
ij_javascript_prefer_parameters_wrap = false
118+
ij_javascript_reformat_c_style_comments = false
119+
ij_javascript_space_after_colon = true
120+
ij_javascript_space_after_comma = true
121+
ij_javascript_space_after_dots_in_rest_parameter = false
122+
ij_javascript_space_after_generator_mult = true
123+
ij_javascript_space_after_property_colon = true
124+
ij_javascript_space_after_quest = true
125+
ij_javascript_space_after_type_colon = true
126+
ij_javascript_space_after_unary_not = false
127+
ij_javascript_space_before_async_arrow_lparen = true
128+
ij_javascript_space_before_catch_keyword = true
129+
ij_javascript_space_before_catch_left_brace = true
130+
ij_javascript_space_before_catch_parentheses = true
131+
ij_javascript_space_before_class_lbrace = true
132+
ij_javascript_space_before_class_left_brace = true
133+
ij_javascript_space_before_colon = true
134+
ij_javascript_space_before_comma = false
135+
ij_javascript_space_before_do_left_brace = true
136+
ij_javascript_space_before_else_keyword = true
137+
ij_javascript_space_before_else_left_brace = true
138+
ij_javascript_space_before_finally_keyword = true
139+
ij_javascript_space_before_finally_left_brace = true
140+
ij_javascript_space_before_for_left_brace = true
141+
ij_javascript_space_before_for_parentheses = true
142+
ij_javascript_space_before_for_semicolon = false
143+
ij_javascript_space_before_function_left_parenth = true
144+
ij_javascript_space_before_generator_mult = false
145+
ij_javascript_space_before_if_left_brace = true
146+
ij_javascript_space_before_if_parentheses = true
147+
ij_javascript_space_before_method_call_parentheses = false
148+
ij_javascript_space_before_method_left_brace = true
149+
ij_javascript_space_before_method_parentheses = false
150+
ij_javascript_space_before_property_colon = false
151+
ij_javascript_space_before_quest = true
152+
ij_javascript_space_before_switch_left_brace = true
153+
ij_javascript_space_before_switch_parentheses = true
154+
ij_javascript_space_before_try_left_brace = true
155+
ij_javascript_space_before_type_colon = false
156+
ij_javascript_space_before_unary_not = false
157+
ij_javascript_space_before_while_keyword = true
158+
ij_javascript_space_before_while_left_brace = true
159+
ij_javascript_space_before_while_parentheses = true
160+
ij_javascript_spaces_around_additive_operators = true
161+
ij_javascript_spaces_around_arrow_function_operator = true
162+
ij_javascript_spaces_around_assignment_operators = true
163+
ij_javascript_spaces_around_bitwise_operators = true
164+
ij_javascript_spaces_around_equality_operators = true
165+
ij_javascript_spaces_around_logical_operators = true
166+
ij_javascript_spaces_around_multiplicative_operators = true
167+
ij_javascript_spaces_around_relational_operators = true
168+
ij_javascript_spaces_around_shift_operators = true
169+
ij_javascript_spaces_around_unary_operator = false
170+
ij_javascript_spaces_within_array_initializer_brackets = false
171+
ij_javascript_spaces_within_brackets = false
172+
ij_javascript_spaces_within_catch_parentheses = false
173+
ij_javascript_spaces_within_for_parentheses = false
174+
ij_javascript_spaces_within_if_parentheses = false
175+
ij_javascript_spaces_within_imports = false
176+
ij_javascript_spaces_within_interpolation_expressions = false
177+
ij_javascript_spaces_within_method_call_parentheses = false
178+
ij_javascript_spaces_within_method_parentheses = false
179+
ij_javascript_spaces_within_object_literal_braces = false
180+
ij_javascript_spaces_within_object_type_braces = true
181+
ij_javascript_spaces_within_parentheses = false
182+
ij_javascript_spaces_within_switch_parentheses = false
183+
ij_javascript_spaces_within_type_assertion = false
184+
ij_javascript_spaces_within_union_types = true
185+
ij_javascript_spaces_within_while_parentheses = false
186+
ij_javascript_special_else_if_treatment = true
187+
ij_javascript_ternary_operation_signs_on_next_line = false
188+
ij_javascript_ternary_operation_wrap = off
189+
ij_javascript_union_types_wrap = on_every_item
190+
ij_javascript_use_chained_calls_group_indents = false
191+
ij_javascript_use_double_quotes = false
192+
ij_javascript_use_explicit_js_extension = global
193+
ij_javascript_use_path_mapping = always
194+
ij_javascript_use_public_modifier = false
195+
ij_javascript_use_semicolon_after_statement = true
196+
ij_javascript_var_declaration_wrap = normal
197+
ij_javascript_while_brace_force = always
198+
ij_javascript_while_on_new_line = false
199+
ij_javascript_wrap_comments = false

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 175 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,175 @@
1-
# chrome-extension-media-downloader
2-
Chrome extension to download music, videos and images from website
1+
# Image Downloader
2+
3+
If you need to bulk download images from a web page, with this extension you can:
4+
5+
- See images that the page contains and links to
6+
- Filter them by width, height, and URL; supports wildcard and regex
7+
- Optionally show only images from links
8+
- Select images to download by clicking on the image
9+
- Use dedicated buttons to download or open individual images in new tabs
10+
- Customize image display width, columns, border size, and color
11+
- Hide filters, buttons and notifications you don't need
12+
13+
When you press the "Download" button, all selected images are saved to the default download directory of Chrome, or to a directory inside it if you specify a subfolder name.
14+
15+
WARNING: If you haven't set up a default download directory, you will have to manually choose the save location for each image, which might open a lot of popup windows. It is not recommended to attempt to download too many images at once without a default download directory.
16+
17+
# Known Issues
18+
19+
This extension can't always extract the full-resolution images that open when you click a photo (e.g. in Facebook albums). That's because the page doesn't directly link to the image, but uses a script.
20+
If you need that kind of functionality, there are other extensions that can be useful like Hover Zoom, even if you can't mass download images with it.
21+
22+
# Change Log
23+
24+
3.0.0
25+
- Design refresh
26+
27+
2.4.2:
28+
29+
- Workaround for Chrome disallowing access to cross-domain CSS rules
30+
31+
2.4.1:
32+
33+
- Fixed an issue where invalid URLs would break the extension - https://github.com/vdsabev/image-downloader/issues/23
34+
- Updated Zepto.js to 1.2.0
35+
36+
2.4:
37+
38+
- Added an option for renaming files before downloading
39+
40+
2.3:
41+
42+
- Added support for BMP, SVG, and WebP images
43+
- Added support for relative URLs
44+
- Improved popup loading speed by searching through less elements
45+
- Replaced deprecated `chrome.extension` calls with `chrome.runtime`
46+
47+
2.2:
48+
49+
- Removed the unnecessary permission to access tabs
50+
- Removed the donation prompt due to complains from some users that it doesn't disappear after the first time as it should; now, the options page will be opened on first install instead
51+
- Save the value of the URL filter
52+
- Another attempt to fix some sizing issues
53+
54+
2.1:
55+
56+
- Added image width / height filters
57+
- Added a one-time reset of all settings due to some people having sizing issues
58+
- Removed the sort by URL option
59+
60+
2.0:
61+
62+
- Added the ability to save the files to a subfolder
63+
- Utilized the Google Chrome downloads API
64+
- Implemented a cleaner, grid-based design
65+
- Clicking on an image URL textbox will now automatically select the text so users can copy it
66+
- Fixed a few minor display issues
67+
- Added settings for number of columns, removed border style setting
68+
- Added donation buttons on the options page
69+
70+
1.3:
71+
72+
- Images used in a style tag will now also be included at the end of the list. Only images from inline style attributes of elements used to be included.
73+
- Added support for data URI
74+
- Several bug fixes and optimizations
75+
76+
1.2:
77+
78+
- Changed the URL above the image to be displayed in a read-only textbox
79+
- Moved the image checkboxes to the top and added open & download buttons below each
80+
- Initially disabled the "Download" button and "All" checkbox
81+
- Introduced a few new options to hide filters, buttons and notification
82+
- Removed the body width option; the width of the popup now resizes relatively to the maximum image width option
83+
- Streamlined the design
84+
85+
1.1:
86+
87+
- Fixed saving of minimum and maximum image width
88+
- Added the URL above the image itself and an option to toggle it
89+
- Added wildcard filter mode (alongside normal and regex)
90+
- The state of the selected filters will now be saved
91+
- Moved the "Sort by URL" option back to the filters
92+
- Added a "Clear Data" button to options page. While the extension does not use a lot of local storage yet, someone might appreciate the option.
93+
- Refactored a lot of code, especially the use of local storage
94+
95+
1.0.13:
96+
97+
- Added a notification to let the user know that download has started
98+
- Added some animations and polished the options notifications a bit more
99+
- Fixed some event handlers that were being attached multiple times
100+
101+
1.0.12:
102+
103+
- Migrated to jQuery
104+
- Implemented indeterminate state for "All" checkbox
105+
- The "Download" button will now be disabled if no images are checked
106+
- Fixed a bug with reseting options - now the user can choose to save the reset values or simply cancel the reset by reloading the page - just like it says in the notification
107+
108+
1.0.11:
109+
110+
- Changed the download mechanism to support Chrome v21+
111+
- Added an "Only show linked images" filter option that can be useful when you only want to download images that are in a URL on the page.
112+
113+
1.0.10:
114+
115+
- Added a download confirmation
116+
117+
1.0.9:
118+
119+
- The number of images will now be displayed next to the "All" checkbox
120+
121+
1.0.8:
122+
123+
- Added detection of image URLs in anchor tags; note that this feature will not detect URLs that don't have .jpg, .jpeg, .gif or .png file extensions - it relies on a regular expression as to avoid possibly sending hundreds of requests to external servers
124+
125+
1.0.7:
126+
127+
- Removed the desktop notification system that popped up when you press "Download" in favor of a text description that should feel easier to control (through Options) and less intrusive; this should also require less permissions for the extension
128+
- Added an option to hide the download notification; most people should understand the download process after only reading it once
129+
- Made some minor UI tweaks
130+
131+
1.0.6:
132+
133+
- Fixed an issue with multiple unnecessary empty images
134+
135+
1.0.5:
136+
137+
- Elements that display an image using the "background-image" CSS property will now also be extracted
138+
139+
1.0.4:
140+
141+
- Added a notification that alerts the user when the download process has begun and explains where to look for the files
142+
143+
# Credits
144+
145+
This extension is and always will be free, open-source, and without targeted ads or tracking algorithms.
146+
You can find the source code here: https://github.com/vdsabev/image-downloader
147+
148+
Based on the Google Chrome Extension sample "Download Links": https://github.com/GoogleChrome/chrome-extensions-samples/tree/master/api/downloads/download_links
149+
150+
Uses the tiny, but awesome JSS library: https://github.com/Box9/jss
151+
152+
# License
153+
154+
Copyright (c) 2012-2021 Vladimir Sabev
155+
156+
Permission is hereby granted, free of charge, to any person
157+
obtaining a copy of this software and associated documentation
158+
files (the "Software"), to deal in the Software without
159+
restriction, including without limitation the rights to use,
160+
copy, modify, merge, publish, distribute, sublicense, and/or sell
161+
copies of the Software, and to permit persons to whom the
162+
Software is furnished to do so, subject to the following
163+
conditions:
164+
165+
The above copyright notice and this permission notice shall be
166+
included in all copies or substantial portions of the Software.
167+
168+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
169+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
170+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
171+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
172+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
173+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
174+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
175+
OTHER DEALINGS IN THE SOFTWARE.

css/bootstrap.min.css

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)