• <i id='aBtOk'><tr id='aBtOk'><dt id='aBtOk'><q id='aBtOk'><span id='aBtOk'><b id='aBtOk'><form id='aBtOk'><ins id='aBtOk'></ins><ul id='aBtOk'></ul><sub id='aBtOk'></sub></form><legend id='aBtOk'></legend><bdo id='aBtOk'><pre id='aBtOk'><center id='aBtOk'></center></pre></bdo></b><th id='aBtOk'></th></span></q></dt></tr></i><div id='aBtOk'><tfoot id='aBtOk'></tfoot><dl id='aBtOk'><fieldset id='aBtOk'></fieldset></dl></div>

      <tfoot id='aBtOk'></tfoot>
      <legend id='aBtOk'><style id='aBtOk'><dir id='aBtOk'><q id='aBtOk'></q></dir></style></legend>
      • <bdo id='aBtOk'></bdo><ul id='aBtOk'></ul>
      1. <small id='aBtOk'></small><noframes id='aBtOk'>

      2. Chrome和Firefox中的秘密复制到剪贴板JavaScript功能?

        时间:2023-10-02

        <small id='bo1Dv'></small><noframes id='bo1Dv'>

          <tfoot id='bo1Dv'></tfoot>
          • <legend id='bo1Dv'><style id='bo1Dv'><dir id='bo1Dv'><q id='bo1Dv'></q></dir></style></legend>
              <bdo id='bo1Dv'></bdo><ul id='bo1Dv'></ul>
              <i id='bo1Dv'><tr id='bo1Dv'><dt id='bo1Dv'><q id='bo1Dv'><span id='bo1Dv'><b id='bo1Dv'><form id='bo1Dv'><ins id='bo1Dv'></ins><ul id='bo1Dv'></ul><sub id='bo1Dv'></sub></form><legend id='bo1Dv'></legend><bdo id='bo1Dv'><pre id='bo1Dv'><center id='bo1Dv'></center></pre></bdo></b><th id='bo1Dv'></th></span></q></dt></tr></i><div id='bo1Dv'><tfoot id='bo1Dv'></tfoot><dl id='bo1Dv'><fieldset id='bo1Dv'></fieldset></dl></div>

                  <tbody id='bo1Dv'></tbody>
                  本文介绍了Chrome和Firefox中的秘密复制到剪贴板JavaScript功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  更新

                  看起来 还定义了一个函数列表:

                  this.clear = function()//没有网页交互{Firebug.Console.clear(context);};this.inspect = function(obj, panelName)//没有网页交互{Firebug.chrome.select(obj, panelName);};this.keys = 函数(o){返回 FBL.keys(o);//对象来自页面,未包装};this.values = 函数(o){返回 FBL.values(o);//对象来自页面,未包装};//等等...

                  Update

                  Looks like browsers are starting to support copy natively in JS


                  In the console windows of both Chrome and Firefox on Mac I can execute

                  copy("party in your clipboard!");
                  

                  and the text gets copied to my clipboard. I have searched SO and Google and can't seem to find anything on this.

                  • Are these specific to each browser?
                  • Where can I find more information on these JavaScript functions?

                  Browser versions:

                  JavaScript returned from Chrome console when executing 'copy'

                  function (object)
                      {
                          if (injectedScript._type(object) === "node") {
                              var nodeId = InjectedScriptHost.pushNodePathToFrontend(object, false, false);
                              InjectedScriptHost.copyNode(nodeId);
                          } else
                              InjectedScriptHost.copyText(object);
                      }
                  

                  • What does this code mean?

                  Here are 2 screenshots of executing copy function in Chrome console with all chrome extensions disabled

                  解决方案

                  I believe these are predefined Firebug console functions - at least that seems to be the case for Firebug. If you try calling window.copy for instance, you'll get a warning about function not defined, so it's definitely not a browser function, and cannot be used in normal JavaScript files. The following functions also seems to work in the JavaScript console, after playing around with it a bit:

                  • clear()
                  • profile()

                  Running these in the Chrome console reveals the source behind these functions in the Webkit console:

                  > profile
                  function ()
                  {
                  return console.profile.apply(console, arguments)
                  }
                  
                  > clear
                  function ()
                  {
                  InjectedScriptHost.clearConsoleMessages();
                  }
                  
                  > copy
                  function (object)
                  {
                  if (injectedScript._type(object) === "node")
                  object = object.outerHTML;
                  InjectedScriptHost.copyText(object);
                  }
                  

                  While the Firebug source also defines a list of functions:

                  this.clear = function()  // no web page interaction
                  {
                      Firebug.Console.clear(context);
                  };
                  
                  this.inspect = function(obj, panelName)  // no web page interaction
                  {
                      Firebug.chrome.select(obj, panelName);
                  };
                  
                  this.keys = function(o)
                  {
                      return FBL.keys(o);  // the object is from the page, unwrapped
                  };
                  
                  this.values = function(o)
                  {
                      return FBL.values(o); // the object is from the page, unwrapped
                  };
                  
                  // etc...
                  

                  这篇关于Chrome和Firefox中的秘密复制到剪贴板JavaScript功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:配置 grunt 复制任务以排除文件/文件夹 下一篇:javascript:在函数(){}中使用当前的for循环计数器值?

                  相关文章

                    <small id='SUcZH'></small><noframes id='SUcZH'>

                  1. <legend id='SUcZH'><style id='SUcZH'><dir id='SUcZH'><q id='SUcZH'></q></dir></style></legend>

                      <bdo id='SUcZH'></bdo><ul id='SUcZH'></ul>
                    <tfoot id='SUcZH'></tfoot>

                    <i id='SUcZH'><tr id='SUcZH'><dt id='SUcZH'><q id='SUcZH'><span id='SUcZH'><b id='SUcZH'><form id='SUcZH'><ins id='SUcZH'></ins><ul id='SUcZH'></ul><sub id='SUcZH'></sub></form><legend id='SUcZH'></legend><bdo id='SUcZH'><pre id='SUcZH'><center id='SUcZH'></center></pre></bdo></b><th id='SUcZH'></th></span></q></dt></tr></i><div id='SUcZH'><tfoot id='SUcZH'></tfoot><dl id='SUcZH'><fieldset id='SUcZH'></fieldset></dl></div>