Skip to content

Commit

Permalink
Clean up code, bump version number for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
bijij committed Nov 1, 2019
1 parent 6ca74c9 commit 88384ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 1 addition & 4 deletions html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@
<a href="https://github.com/bijij" target="_blank"><span>© 2018 Joshua Butt</span></a>
<br>

<!--
<br>
<a href="https://goo.gl/Kxyaq8" target="_blank">
<a href="https://www.paypal.me/bijij/5" target="_blank">
<button type="button">
<img src="../img/paypal.png" height="15px"/>
<span data-localise="__MSG_donatePayPal__">&nbsp;Donate via Paypal</span>
</button>
</a>
<br>
-->


<br>
<span class="legal">
Expand Down
18 changes: 12 additions & 6 deletions js/content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function findImageURL(container, version) {
case VERSIONS.JUL19:
var iframe = container.querySelector('iframe.irc_ifr');
if (!iframe)
return findImage(container, false);
return findImageURL(container, VERSIONS.FEB18);
image = iframe.contentDocument.querySelector('img#irc_mi');
break;
case VERSIONS.OCT19:
image = container.querySelector('img[src].n3VNCb');
if (images.hasOwnProperty(image.src)) {
if (image.src in images) {
return images[image.src];
}
}
Expand Down Expand Up @@ -283,7 +283,7 @@ function addLinks(node) {

// Check if source holds array of images
try {
const start_search = "AF_initDataCallback({key: 'ds:2', isError: false , hash: '3', data:function(){return ";
const start_search = 'AF_initDataCallback({key: \'ds:2\', isError: false , hash: \'3\', data:function(){return ';
const end_search = '}});</script>';

var start_index = document.documentElement.innerHTML.indexOf(start_search) + start_search.length;
Expand All @@ -294,13 +294,19 @@ try {
for (var i = 0; i < meta.length; i++) {
try {
images[meta[i][1][2][0]] = meta[i][1][3][0];
} catch (error) {}
} catch (error) {
if (DEBUG)
console.log('ViewImage: Skipping image');
}
}

if (DEBUG)
console.log('ViewImage: Successfully created source images array.')
console.log('ViewImage: Successfully created source images array.');

} catch (error) {}
} catch (error) {
if (DEBUG)
console.log('ViewImage: Failed to create source images array.');
}


// Define the mutation observers
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_appName__",
"version": "3.1.0",
"version": "3.2.0",
"description": "__MSG_appDesc__",
"default_locale": "en",
"icons": {
Expand Down

0 comments on commit 88384ef

Please sign in to comment.