Skip to content

Commit

Permalink
Addressed #7 by adding reels support.
Browse files Browse the repository at this point in the history
Also addressed some other issues discovered when testing functionality.
Need to push to web stores.
  • Loading branch information
Ondkloss committed Nov 9, 2020
1 parent 96f906f commit 1948969
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# IG+VSCO fullsize

Click extension icon to open current Instagram or VSCO image or profile picture in the highest resolution possible.
Click extension icon to open current Instagram, VSCO or TikTok image or profile picture in the highest resolution possible.

Released on [Chrome Web Store](https://chrome.google.com/webstore/detail/ig+vsco-fullsize/ngdfnokoifnihnknoibnbhfhnkmlfocb) and [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/ig-vsco-fullsize/). See example below:

![Example usage](example.gif)

Functionality tested on 2020-06-22.
Functionality tested on 2020-11-09.

## Changelog

### 1.3.2

- Added support for opening reels. Thanks to [@JohnPlanetary](https://github.com/JohnPlanetary) for reporting issue
- Fixed VSCO profile picture after class name change
- Fixed TikTok profile issue, but still has trouble after browsing between profiles
- Known issue with HD profile pictures after API-change still being investigated

### 1.3.1

Added ctrl/command-click to Instagram "not logged in" functionality. This allows for opening in new window, so that you don't loose your scroll position.
Expand Down
4 changes: 2 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ chrome.browserAction.onClicked.addListener(function (tab) {
console.log('Opening fullsize with URL: ' + tab.url);
if (tab.url.startsWith('https://www.instagram.com/')) {
const profileRegex = /^(https:\/\/www\.instagram\.com\/[a-zA-Z0-9._-]+)\/?(\?.+)?$/;
const mediaRegex = /^(https:\/\/www\.instagram\.com\/p\/[a-zA-Z0-9_-]+)\/?(\?.+)?$/;
const mediaRegex = /^(https:\/\/www\.instagram\.com\/(p|reel)\/[a-zA-Z0-9_-]+)\/?(\?.+)?$/;

// Accessing a profile image
if (profileRegex.test(tab.url)) {
Expand All @@ -103,7 +103,7 @@ chrome.browserAction.onClicked.addListener(function (tab) {
console.log('Error: ' + error);
});
}
// Accessing an image/video
// Accessing an image/video or a reel
else if (mediaRegex.test(tab.url)) {
const mediaUrl = mediaRegex.exec(tab.url)[1];
fetch(mediaUrl + '?__a=1').then(function (response) {
Expand Down
14 changes: 10 additions & 4 deletions src/content_tiktok.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,23 @@ function findUrl() {
const source = document.getElementsByClassName('video-player')[0].src;
return source;
}


}

function findProfileUrl() {
const element = document.getElementById('__NEXT_DATA__');
const json = JSON.parse(element.innerHTML);

if (json && 'userInfo' in json.props.pageProps) {
const avatarMedium = json.props.pageProps.userInfo.user.avatarMedium;
const result = avatarMedium.replace("720x720", "1080x1080");
let result = json.props.pageProps.userInfo.user.avatarLarger;

if(!result) {
result = json.props.pageProps.userInfo.user.avatarMedium;
}

if(!result) {
result = json.props.pageProps.userInfo.user.avatarThumb;
}

return result;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/content_vsco.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function findUrl() {
}

function findProfileUrl() {
const imageElement = document.querySelector("img[class*='css-1gtfl7l']");
const imageElement = document.querySelector("img[class*='css-1u1zie3']");
const content = imageElement.src;
return content.substring(0, content.lastIndexOf('?'));
}
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"version": "1.3.1",
"version": "1.3.2",
"manifest_version": 2,
"default_locale": "en",
"permissions": [
Expand Down

0 comments on commit 1948969

Please sign in to comment.