-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvinstagram.user.js
40 lines (36 loc) · 1.46 KB
/
vinstagram.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ==UserScript==
// @name View Instagram Without Login
// @namespace bitst0rm
// @version 0.0.3
// @description View Instagram without login via imginn.com
// @author bitst0rm
// @license WTFPL
// @updateURL https://github.com/bitst0rm-pub/View-Instagram/raw/master/vinstagram.user.js
// @downloadURL https://github.com/bitst0rm-pub/View-Instagram/raw/master/vinstagram.user.js
// @icon https://github.com/bitst0rm-pub/View-Instagram/raw/master/logo.png
// @match https://www.instagram.com/*
// @match http://www.instagram.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (window.document.cookie.indexOf("ds_user_id") == -1) {
var go = function() {
var p = window.location.pathname.split("/");
if (/^((?!(accounts|developer|about|legal|explore|directory|stories|reel)).)*$/.test(p[1]) && p.length > 2 && p[1] !== "p") {
window.location.replace("https://imginn.com/" + p[1] + "/?lang=" + window.navigator.languages[0].split("-")[0]);
}
if (p[1] == "p") {
window.location.replace("https://imginn.com" + window.location.pathname)
}
};
(function(old) {
window.history.pushState = function() {
old.apply(window.history, arguments);
go();
};
})(window.history.pushState);
go();
}
})();