Полезная информация

Юристы зарабатывают огромные деньги и славу, оперируя хорошим знанием законов. Правила форума — простой путь к успешному общению.

№126-02-2015 02:51:16

Sekotka
Участник
 
Группа: Members
Зарегистрирован: 07-02-2010
Сообщений: 44
UA: Firefox 35.0

Проблема с протоколом spoof

Помогите пожалуйста!
Проблема такая.
Есть Aurora 9.0.1 (сильно доработанная сторонними программистами) и дополнение refspoof 0.9.5
Дополнение работает отлично в рамках своих возможностей, но не работает главная функция. В URL строке можно ввести ссылку вида spoof://site.ru;ref://site2.ru и при переходе на site1.ru реферером будет site2.ru. Вроде все просто и на обычных фаерфоксах все работает.
Но тут не работает. Аврора пишет, что протокол Spoof она не знает.
Подскажите пожалуйста, как ей указать на это дополнение, что оно должно его обрабатывать.
Стоит отметить, что при вводе в тулбар этого дополнения, все работает, а в URL строке ошибка. В конфиге никаких зацепок нет.
Спасибо за любую помощь!

Отсутствует

 

№226-02-2015 12:18:55

Sekotka
Участник
 
Группа: Members
Зарегистрирован: 07-02-2010
Сообщений: 44
UA: Firefox 35.0

Re: Проблема с протоколом spoof

Боюсь, что это невозможно, прошло уже года 3-4 и связи с ними нет. Я тогда то просто готовый продукт скачивал, поддержка его давно закончилась со стороны разработчиков. Может быть знаете, где протоколы обрабатываются?

+забыл сказать, сильно доработанная, это просто в нее интегрированы дополнения специальные по обработке JS, которые доступны только для нее.

Отредактировано Sekotka (26-02-2015 13:47:11)

Отсутствует

 

№326-02-2015 15:33:33

Sekotka
Участник
 
Группа: Members
Зарегистрирован: 07-02-2010
Сообщений: 44
UA: Firefox 35.0

Re: Проблема с протоколом spoof

Приложение поддерживается для версии FF 3.0, с 4.0 вроде как перестало, я его в обход ставил, возможно поэтому. Вот файл, который отвечает за этот протокол spoof

скрытый текст
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla.
*
* The Initial Developer of the Original Code is IBM Corporation.
* Portions created by IBM Corporation are Copyright (C) 2004
* IBM Corporation. All Rights Reserved.
*
* Contributor(s):
*   Darin Fisher <darin@meer.net>
*   Doron Rosenberg <doronr@us.ibm.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */

//  edited by ebricca 2004/04/16
//  came from the magpie / bkstr implementation from bengoodger to this
//  ideas also from the livehttpheaders -> observer

// ty sent me a correction to get it working with ffx 20 .. that i incorporate here



// spoof protocol related
const kSCHEME = "spoof";
const kPROTOCOL_NAME = "Spoofing Protocol";
const kPROTOCOL_CONTRACTID = "@mozilla.org/network/protocol;1?name=" + kSCHEME;
const kPROTOCOL_CID = Components.ID("65F7562E-DAB9-11D8-B5F0-00039388DA40");

// Mozilla defined
const kSIMPLEURI_CONTRACTID = "@mozilla.org/network/simple-uri;1";
const kIOSERVICE_CONTRACTID = "@mozilla.org/network/io-service;1";
const nsISupports = Components.interfaces.nsISupports;
const nsIIOService = Components.interfaces.nsIIOService;
const nsIProtocolHandler = Components.interfaces.nsIProtocolHandler;
const nsIURI = Components.interfaces.nsIURI;

var refnsiURI = null;

// logging
var aConsoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
function dumpme(aString)
{
aConsoleService.logStringMessage(aString);
}


function Protocol()
{
}

Protocol.prototype =
{
  //


  QueryInterface: function(iid)
  {
    if (!iid.equals(nsIProtocolHandler) &&
        !iid.equals(nsISupports))
      throw Components.results.NS_ERROR_NO_INTERFACE;


    return this;
  },

  scheme: kSCHEME,
  defaultPort: -1,
  protocolFlags: nsIProtocolHandler.URI_STD |
                 nsIProtocolHandler.URI_LOADABLE_BY_ANYONE,
 
  allowPort: function(port, scheme)
  {
    return false;
  },

  newURI: function(spec, charset, baseURI)
  {
    var uri = Components.classes[kSIMPLEURI_CONTRACTID].createInstance(nsIURI);
    uri.spec = spec;
    return uri;
  },

  newChannel: function(aURI)
  {


    // before even beginning to spoof make sure it even has an effect
    xpPref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
    xpPref.setIntPref("network.http.sendRefererHeader", 2); 
    //history handling / handle spoofuri
    xpPref.setCharPref("refspoof.historyWatch", aURI.spec);

    var ios = Components.classes[kIOSERVICE_CONTRACTID].getService(nsIIOService);   
    var silentnsiURI  = ios.newURI("javascript:", null, null);
    var silentChannel = ios.newChannelFromURI(silentnsiURI).QueryInterface(Components.interfaces.nsIChannel);

return silentChannel;

}
}



var ProtocolFactory = new Object();

ProtocolFactory.createInstance = function (outer, iid)
{
  if (outer != null)
    throw Components.results.NS_ERROR_NO_AGGREGATION;

  if (!iid.equals(nsIProtocolHandler) &&
      !iid.equals(nsISupports))
    throw Components.results.NS_ERROR_NO_INTERFACE;

  return new Protocol();
}


/**
* JS XPCOM component registration goop:
*
* We set ourselves up to observe the xpcom-startup category.  This provides
* us with a starting point.
*/

var nsSpoofProtocolModule = new Object();

nsSpoofProtocolModule.registerSelf = function (compMgr, fileSpec, location, type)
{
  compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  compMgr.registerFactoryLocation(kPROTOCOL_CID,
                                  kPROTOCOL_NAME,
                                  kPROTOCOL_CONTRACTID,
                                  fileSpec,
                                  location,
                                  type);
}

nsSpoofProtocolModule.getClassObject = function (compMgr, cid, iid)
{
  if (!cid.equals(kPROTOCOL_CID))
    throw Components.results.NS_ERROR_NO_INTERFACE;

  if (!iid.equals(Components.interfaces.nsIFactory))
    throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
   
  return ProtocolFactory;
}

nsSpoofProtocolModule.canUnload = function (compMgr)
{
  return true;
}

function NSGetModule(compMgr, fileSpec)
{
  return nsSpoofProtocolModule;
}


Может, начиная с 4-го FF что-то изменилось и необходимы минимальные правки? Очень нужно именно это дополнение. Готов компенсировать потраченное время!

Отсутствует

 

№426-02-2015 16:39:57

Sekotka
Участник
 
Группа: Members
Зарегистрирован: 07-02-2010
Сообщений: 44
UA: Firefox 35.0

Re: Проблема с протоколом spoof

Спасибо

Может быть Вы еще подскажете... Дополнение hxxp делает тоже самое, но имеет вид ссылки hxxp://site1.ru;ref://site2.ru , но также не работает. У меня задача проста, с помощью дополнений или как угодно иметь возможность вручную задавать рефферара к открываемому URL. Т.е. открывать новую вкладку с site1.ru, чтобы реферером стоял site2.ru. Все.

Может быть эту проблему можно решить через CustomButtons или еще как?

Отредактировано Sekotka (26-02-2015 16:40:10)

Отсутствует

 

№526-02-2015 19:09:37

turbot
Участник
 
Группа: Members
Зарегистрирован: 09-10-2011
Сообщений: 2529
UA: Firefox 39.0

Re: Проблема с протоколом spoof

screenshot%2525202015-02-26%252520002.png

Название аддона на скрине видно.

Отсутствует

 

№627-02-2015 01:03:56

Sekotka
Участник
 
Группа: Members
Зарегистрирован: 07-02-2010
Сообщений: 44
UA: Firefox 35.0

Re: Проблема с протоколом spoof

Спасибо, но немного не то. Мне нужно простого вида функция URL:сайт1 и REF:сайт2, где я на лету могу менять или брать из файла, а не вручную вписывать каждый раз при малейших изменениях. У меня работа с большим количеством рефереров, потому Ваш вариант усложнит работу в 10 раз, нежели это делало ранее дополнение refspoof или hxxp...

Отредактировано Sekotka (27-02-2015 01:17:00)

Отсутствует

 

Board footer

Powered by PunBB
Modified by Mozilla Russia
Copyright © 2004–2020 Mozilla Russia GitHub mark
Язык отображения форума: [Русский] [English]