Skip to content

Commit

Permalink
Update to v4.1.2.0 (#20)
Browse files Browse the repository at this point in the history
* Made fixes according to DeepScan. Unable to sign XPI

* - Adding custom buttons back
- Fixed addition errors
- Added square button

* - Adjusted options page - Fixed minor saving errors - Found bugs on iTunes

* - Adjusted popup styling
- Made `ITEM_TYPE` strict in background.js

* - Updated popup styling
- Added `theatre` as a keyword for films

* - Updated options page
- Merged changes into other extensions
  • Loading branch information
Ephellon authored Feb 14, 2020
1 parent df44a6b commit 2639c86
Show file tree
Hide file tree
Showing 222 changed files with 23,900 additions and 3,712 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Use this to hide the **Web to Plex** button. It changes the button's opacity to
Use this to reload **Web to Plex** on the current page. This can sometimes fix loading issues or cache errors.

### Plex URL
This is a *moderately advance* setting, but is very useful to know. If you know your Plex server's URL (e.g. `https://localhost:32400`), then you can specify this and avoid bandwidth usage, as the extension will communicate with Plex on your device instead of `https://app.plex.tv/`.
This is a *moderately advanced* setting, but is very useful to know. If you know your Plex server's URL (e.g. `https://localhost:32400`), then you can specify this and avoid bandwidth usage, as the extension will communicate with Plex on your device instead of `https://app.plex.tv/`.

### Find this | Right Click
If you aren't satisfied with a found item, or it is incorrect, you can right click the page and use the **Web to Plex | Find "XYZ"** feature to search for the item.
Expand Down
Binary file modified moz.xpi
Binary file not shown.
Binary file modified moz.zip
Binary file not shown.
Binary file added moz/Glyphicons Social.woff
Binary file not shown.
Binary file added moz/Glyphicons.woff
Binary file not shown.
Binary file added moz/Plex.bold.woff
Binary file not shown.
Binary file added moz/Plex.bold.woff2
Binary file not shown.
Binary file added moz/Plex.woff
Binary file not shown.
Binary file added moz/Plex.woff2
Binary file not shown.
39 changes: 39 additions & 0 deletions moz/__layout__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// optional
// "Friendly Name" requires: api|username|password|token
// api - the user's API keys (external, such as TMDb/OMDb)
// username - the user's usernames (internal, such as Radarr/Sonarr/etc.)
// password - the user's passwords (internal)
// token - the user's tokens (internal)
// Example: "Web to Plex" requires: api, token

let script = {
// required
"url": "< URL RegExp >",
// Example: *://*.amazon.*/*/video/(detail|buy)/*
// *:// - match any protocol (http, https, etc.)
// *.amazon - match any sub-domain (www, ww5, etc.)
// .* - match any TLD (com, net, org, etc.)
// /* - match any path
// (detail|buy) - match one of the items

// optional
"ready": () => { /* return a boolean to describe if the page is ready */ },

// optional
"timeout": 1000, // if the script fails to complete, retry after ... milliseconds

// required
"init": (ready) => {
let _title, _year, _image, R = RegExp;

let title = $('#title').first,
year = $('#year').first,
image = $('#image').first,
type = script.getType(); // described below

return { type, title, year, image };
},

// optional | functionality only
"getType": () => 'movie' || 'show',
};
37 changes: 37 additions & 0 deletions moz/__test__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
let script = {
// required
"url": "*://webtoplex.github.io/web/test/*",
// Example: *://*.amazon.com/*/video/(detail|buy)/*
// *:// - match any protocol (http, https, etc.)
// *.amazon.com - match any sub-domain (www, ww5, etc.)
// /* - match any path
// (detail|buy) - match one of the items

// optional
"ready": () => {
/* return a boolean to describe if the page is ready */
return !!$('#title').first.textContent.length;
},

// optional
"timeout": 1000, // if the script fails to complete, retry after ... milliseconds

// required
"init": (ready) => {
let _title, _year, _image, R = RegExp;

let title = $('#title').first,
year = $('#year').first,
image = $('#poster').first,
type = script.getType(); // described below

title = title.textContent;
year = +year.textContent;
image = image.src || '';

return { type, title, year, image };
},

// optional | functionality only
"getType": () => $('#example').first.getAttribute('type'),
};
Binary file added moz/_blank.orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added moz/_blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions moz/amazon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.web-to-plex-minion {
margin-right: 8px;
color: #fff!important;
margin-bottom: 8px!important;
line-height: 2!important;
text-decoration: none!important;
width: auto!important;
}

.web-to-plex-minion.wtp--download {
background: linear-gradient(180deg, #f67e56, #f45a26)!important;
}

.web-to-plex-minion.wtp--download:hover {
background: linear-gradient(180deg, #ff8960, #fd6430)!important;
}

.web-to-plex-minion.wtp--found {
background: linear-gradient(180deg, #f7dfa5, #ca7c1f)!important;
}

.web-to-plex-minion.wtp--found:hover {
background: linear-gradient(180deg, #f7dfa5, #f8c022)!important;
}

#tt--0-0 {
background: linear-gradient(180deg, #70767d 0, #696f78 0, #3d444e 100%)!important;
}

#tt--0-0:hover {
background: linear-gradient(180deg, #70767d 0, #696f78 0, #3d444e 100%)!important;
}
14 changes: 14 additions & 0 deletions moz/amazon.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,18 @@ let script = {
'tv':
'movie'
},

"minions": () => {
let actions = $(script.getType() == 'tv'? '#dv-action-box .av-action-button-box': '#dv-action-box');

if(actions.empty)
return;

actions.forEach(element => {
let minion = furnish('a.av-button.av-button--default', {}, 'Web to Plex');

addMinions(minion);
element.appendChild(minion);
});
},
};
8 changes: 6 additions & 2 deletions moz/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ let date = (new Date),
let BACKGROUND_STORAGE = browser.storage.sync || browser.storage.local;
let BACKGROUND_CONFIGURATION;


// returns the proper CORS mode of the URL
let cors = url => ((/^(https|sftp)\b/i.test(url) || /\:(443|22)\b/i.test(url)? '': 'no-') + 'cors');

Expand Down Expand Up @@ -68,7 +67,7 @@ function ChangeStatus({ ITEM_ID, ITEM_TITLE, ITEM_TYPE, ID_PROVIDER, ITEM_YEAR,
// File friendly title
SEARCH_TITLE = ITEM_TITLE.replace(/[\-\s]+/g, '-').replace(/\s*&\s*/g, ' and ').replace(/[^\w\-\'\*\#]+/g, ''),
// Search friendly title
SEARCH_PROVIDER = /\b(tv|show|series)\b/i.test(ITEM_TYPE)? 'GG': /^im/i.test(ID_PROVIDER)? 'VO': /^tm/i.test(ID_PROVIDER)? 'GX': 'GG';
SEARCH_PROVIDER = (ITEM_TYPE == 'show')? 'GG': /^im/i.test(ID_PROVIDER)? 'VO': /^tm/i.test(ID_PROVIDER)? 'GX': 'GG';

ITEM_ID = (ITEM_ID && !/^tt$/i.test(ITEM_ID)? ITEM_ID: '') + '';
ITEM_ID = ITEM_ID.replace(/^.*\b(tt\d+)\b.*$/, '$1').replace(/^.*\bid=(\d+)\b.*$/, '$1').replace(/^.*(?:movie|tv|(?:tv-?)?(?:shows?|series|episodes?))\/(\d+).*$/, '$1');
Expand Down Expand Up @@ -900,6 +899,11 @@ browser.runtime.onMessage.addListener((request = {}, sender, callback) => {
FILE_PATH = (item.path || ''),
ITEM_ID = ((i, I)=>{for(let p in i)if(RegExp('^'+I,'i').test(p))return i[p]})(item, ID_PROVIDER);

if(/movie|film|cinema|theat[re]{2}/i.test(ITEM_TYPE))
ITEM_TYPE = 'movie';
else if(/tv|show|series|episode/i.test(ITEM_TYPE))
ITEM_TYPE = 'show';

if(request.type) {
try {
switch(request.type) {
Expand Down
Loading

0 comments on commit 2639c86

Please sign in to comment.