【问题标题】:iMacros + FF : Linux, command lineiMacros + FF:Linux,命令行
【发布时间】:2012-02-16 10:00:22
【问题描述】:

我想在 Ubuntu 下使用 Firefox 运行 iMacros 脚本,方法是在命令行中指定脚本。不幸的是,浏览器只将文件作为文本打开而不运行它...

有什么线索吗?

【问题讨论】:

    标签: linux firefox imacros


    【解决方案1】:

    您应该手动将宏添加到浏览器,然后以您选择的名称保存。然后你可以调用它

        firefox  http://run.imacros.net/?m=name_of_the_macro.iim
    

    【讨论】:

      【解决方案2】:

      将您的宏代码嵌入到本地 test.htm 文件并通过 firefox 命令行运行此文件(即使使用免费的 iMacros 版本也可以)

      命令行示例是:

      firefox file:///home/test/test.htm
      

      test.htm 文件示例为:

      <html>
         <body onload="window.setTimeout('document.getElementById(\'criimlaunch\').click();', 1000);">
      
            <script>
               var macroCode = '';
      !!!ADD YOUR MACRO HERE!!!
               macroCode += 'PROMPT HELLO!\n';
               macroCode += 'URL GOTO=http://imacros.net/\n';
               macroCode += 'PROMPT BYE!\n';
      !!!ADD YOUR MACRO HERE!!!
               function launchMacro()
                  {
                  try
                     {
                        if(!/^(?:chrome|https?|file)/.test(location))
                        {
                           alert('iMacros: Open webpage to run a macro.');
                           return;
                        }
                     
                        var macro = {}; 
                        macro.source = macroCode;
                        macro.name = 'EmbeddedMacro';
                     
                        var evt = document.createEvent('CustomEvent');
                        evt.initCustomEvent('iMacrosRunMacro', true, true, macro);
                        window.dispatchEvent(evt);
                     }
                  catch(e)
                  {
                     alert('iMacros Bookmarklet error: '+e.toString());
                  };
               }
            </script>
      
            <a id="criimlaunch" href="javascript:launchMacro();">Launch iMacros</a>
      
         </body>
      </html>
      

      查看更多信息: https://wiki.imacros.net/Webextensions#Add_File_Access

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-04-25
        • 1970-01-01
        • 1970-01-01
        • 2021-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-05-05
        相关资源
        最近更新 更多