Skip to content

Commit

Permalink
support activeX object mocker
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Jan 27, 2020
1 parent 16aca54 commit 814de74
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static com.gargoylesoftware.htmlunit.BrowserVersionFeatures.JS_PROPERTY_DESCRIPTOR_NEW_LINE;

import java.io.Serializable;
import java.util.Map;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.ScriptException;
Expand Down Expand Up @@ -279,6 +280,14 @@ protected Context makeContext() {
cx.setClassShutter(new ClassShutter() {
@Override
public boolean visibleToScripts(final String fullClassName) {
final Map<String, String> activeXObjectMap = webClient_.getActiveXObjectMap();
if (activeXObjectMap != null) {
for (String mappedClass : activeXObjectMap.values()) {
if (fullClassName.equals(mappedClass)) {
return true;
}
}
}
return false;
}
});
Expand Down

0 comments on commit 814de74

Please sign in to comment.