-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
ReferenceError: parent is not defined #68
Comments
I found a connection between the current window and the parent. And I was able to get the instance with the variables of the parent window.
It's on my knee, but I would like to get a competent code |
I'll try to look into it! Just quite under water right now... |
Bug Report
Prerequisites
AngleSharp.Css
for CSS support)For more information, see the
CONTRIBUTING
guide.Description
I am parsing Kyocera FS-3040MFP+
Index page have frame set
frameset border=0 cols=* frameborder=NO framespacing=0 rows=1,*
frame name=topframe noResize scrolling=no src="../top.htm"
frame name=main src="../start/start.htm"
and javascript that have same vars
<script language="JavaScript"> var opt_msg1_exist = "_mode_on"; if( opt_msg1_exist == "_mode_on") { var opt_msg1_name = '>Português'; } var OEMFlag = 0; if( OEMFlag == 0 || OEMFlag == 2) { document.write('<title>Kyocera Command Center</title>'); document.write(''); } else document.write('<title></title>'); var lang="rus"; var ModelName="FS-3040MFP+"; var IEMsgShown = false; var currentpage=""; var testData = new Array(); testData[0] = 0; var curPageFlag = false; </script>When run start.htm that have into javascript where set var:
Line 45: parent.FaxNum = FaxNum;
Line 48: parent.CipherCheck = 1;
Line 50: parent.CipherCheck = 0;
etc
As result
Script parsing stops with an error "ReferenceError: parent is not defined"
Steps to Reproduce
[First Step]
var srvJsScripting = new JsScriptingService();
var srvNavigator = new Navigator();
var config = Configuration.Default.WithDefaultLoader(new LoaderOptions { IsResourceLoadingEnabled = true }).With(srvNavigator)
.WithLocaleBasedEncoding().WithCulture("ru-ru").With(srvJsScripting);
var context = BrowsingContext.New(config);
var queryDocument = context.OpenAsync("http://mfu01.al.loc").Result;
[Second Step]
When page start.htm is was processed throw exception "ReferenceError: parent is not defined" and treatment of script is stopped and run next script where into have "parent.Var = " and this have the same error
[and so on...]
Expected behavior:
I want to get variables from the environment of the parent window, read and write data from the child window
Actual behavior:
throw exception "ReferenceError: parent is not defined"
Environment details:
VS 2019, last version of AngleSharp.JS
Possible Solution
Add a property "parent" to the object "Window" to have access to the variables of the parent page
https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
The text was updated successfully, but these errors were encountered: