-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java][BiDi] implement emulation.setScriptingEnabled
#16631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
|
Check comments by the AI bot, these makes sense:
But for 3rd one, we should have this: public class SetScriptingEnabledParameters extends AbstractOverrideParameters {
public SetScriptingEnabledParameters(Boolean enabled) {
if (enabled == Boolean.TRUE) {
throw new IllegalArgumentException(
"Only emulation of disabled JavaScript is supported (enabled must be false or null)");
}
map.put("enabled", enabled); // null or false
}
} |
|
@Delta456 After setting "js enabled = false", how can I reset it back? |
You need to use |
|
I don't see the word "None" in the PR. :) I see only these two variants:
So when I want "true", I have to write "null" instead of "true". Is it logical? Why can't we allow users write "true"? |
|
Ah yes, now I see it. W3C spec allows only false or null. This is a very strange spec IMHO. :) |
asolntsev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good!
diemol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @Delta456!
navin772
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!

User description
🔗 Related Issues
💥 What does this PR do?
Implements https://w3c.github.io/webdriver-bidi/#command-emulation-setScriptingEnabled for Java
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Implements BiDi
emulation.setScriptingEnabledcommand for JavaAdds
SetScriptingEnabledParametersclass with validation logicIncludes comprehensive tests for contexts and user contexts
Adds test HTML page for script execution verification
Diagram Walkthrough
File Walkthrough
Emulation.java
Add setScriptingEnabled method to Emulationjava/src/org/openqa/selenium/bidi/emulation/Emulation.java
setScriptingEnabled()method to Emulation classemulation.setScriptingEnabledwith parametersSetScriptingEnabledParameters.java
New SetScriptingEnabledParameters class with validationjava/src/org/openqa/selenium/bidi/emulation/SetScriptingEnabledParameters.java
AbstractOverrideParametersenabledparameter is false or null onlycontexts()anduserContexts()fluent methodsIllegalArgumentExceptionif enabled is trueSetScriptingEnabledTest.java
Comprehensive tests for setScriptingEnabled functionalityjava/test/org/openqa/selenium/bidi/emulation/SetScriptingEnabledTest.java
setScriptingEnabledwith contexts parametersetScriptingEnabledwith user contexts parameterscript_page.html
Test page for script execution verificationcommon/src/web/script_page.html