K-Meleon

KMeleonWiki > Resources > MacroLibrary > MacroLibrary2 > Detach a layer

Submitted by: Marc


Note: this macro requires the deprecated layers Kplugin for pseudo-tabs; layers are deprecated. The latest official versions of K-Meleon and all active development natively support true tabs.



Notes:

The macro "detach{}" is already available by default in macros.cfg. To use it you only need to associate it with an accelerator.
Unfortunately its behavior has changed with K-Meleon version 0.8.2. Previously the detached layer was receiving the focus, allowing the user to continue surfing with this page. Fixing bug 12 broke this.
This new version of the macro makes use of code from jsnj to circumvent this problem.


In Macros:

Don't forget to comment the old macro.

detach{
  $oldclip = getclipboard();
  setclipboard($URL);
  plugin(layers,Close);
  opennew("about:blank");
  $loaded="go";
}

## add this code from jsnj
$loaded = "";

go{
  id(ID_SELECT_URL);id(ID_EDIT_PASTE);
  id(ID_NAV_GO);$loaded="";
  setclipboard($oldclip);
}

# add the following line in your existing OnLoad{} macro
  $loaded == "" ? 0 : macros($loaded);


In Accelerators:

CTRL ALT D = macros(detach)


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.