Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         VK.com Старый Дизайн ВКонтакте
  3. // @namespace    PopangameRu
  4. // @version      2.3
  5. // @description  Возвращает старый дизайн VK.com на всех страницах и во всех вкладках
  6. // @author       PopangameRu
  7. // @match        https://new.vk.com/*
  8. // @exclude      https://new.vk.com/about
  9. // @exclude      https://new.vk.com/products
  10. // @exclude      https://new.vk.com/dev
  11. // @exclude      https://new.vk.com/dev/*
  12. // @exclude      https://new.vk.com/blog
  13. // @exclude      https://new.vk.com/blog/*
  14. // @exclude      https://new.vk.com/widget_like.php?*
  15. // @exclude      https://new.vk.com/video_ext.php?*
  16. // @exclude      https://new.vk.com/widget_community.php?*
  17. // @exclude      https://new.vk.com/doc*?hash=*
  18. // @run-at       document-body
  19. // @grant        none
  20. // ==/UserScript==
  21.  
  22. function sendPost(url) {
  23.     var form = document.createElement('form');
  24.     form.method = 'post';
  25.     form.action = url;
  26.     document.body.appendChild(form);
  27.     form.submit();
  28. }
  29.  
  30. (function() {
  31.     'use strict';
  32.     var url;
  33.     if (window.location.pathname == '/al_profile.php') {
  34.         url = 'https://vk.com/' + window.location.search.toString().split(/[=&]/)[1];
  35.         sendPost(url);
  36.     } else {
  37.         url = 'https://vk.com' + window.location.href.toString().split(window.location.host)[1];
  38.         sendPost(url);
  39.     }
  40. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement