Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gu imageworks extension
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joetsuihk
gu imageworks extension
Commits
d079dc5e
Commit
d079dc5e
authored
Aug 21, 2020
by
ronald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
can auto-rename downloading zip files
parent
8a58ca50
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
background.js
background.js
+15
-6
manifest.json
manifest.json
+1
-1
popup.js
popup.js
+1
-0
No files found.
background.js
View file @
d079dc5e
'use strict'
;
chrome
.
runtime
.
onInstalled
.
addListener
(
function
()
{
chrome
.
storage
.
sync
.
set
({
color
:
'#3aa757'
},
function
()
{
console
.
log
(
"The color is green."
);
});
});
chrome
.
declarativeContent
.
onPageChanged
.
removeRules
(
undefined
,
function
()
{
chrome
.
declarativeContent
.
onPageChanged
.
addRules
([{
conditions
:
[
new
chrome
.
declarativeContent
.
PageStateMatcher
({
...
...
@@ -15,3 +9,18 @@ chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
actions
:
[
new
chrome
.
declarativeContent
.
ShowPageAction
()]
}]);
});
var
initial
=
0
;
var
a
;
chrome
.
extension
.
onMessage
.
addListener
(
function
(
request
,
sender
,
sendResponse
){
chrome
.
storage
.
local
.
get
(
'idArray'
,
function
(
item
)
{
a
=
item
.
idArray
.
split
(
','
);
});
console
.
log
(
a
);
});
chrome
.
downloads
.
onDeterminingFilename
.
addListener
(
function
(
item
,
suggest
)
{
var
new_filename
=
a
[
initial
]
+
".zip"
;
suggest
({
filename
:
new_filename
});
initial
++
;
});
\ No newline at end of file
manifest.json
View file @
d079dc5e
...
...
@@ -12,7 +12,7 @@
"manifest_version"
:
2
,
"permissions"
:
[
"tabs"
,
"*://*/*"
,
"activeTab"
,
"<all_urls>"
,
"declarativeContent"
,
"storage"
],
"permissions"
:
[
"tabs"
,
"*://*/*"
,
"activeTab"
,
"<all_urls>"
,
"declarativeContent"
,
"storage"
,
"downloads"
],
"page_action"
:
{
"default_popup"
:
"popup.html"
,
...
...
popup.js
View file @
d079dc5e
...
...
@@ -22,6 +22,7 @@ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
chrome
.
storage
.
local
.
set
({
idArray
:
idArray
},
function
()
{
console
.
log
(
"set storage"
);
});
chrome
.
runtime
.
sendMessage
(
null
);
});
}
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment